Package 'universe'

Title: Tools for Working with R-universe <https://r-universe.dev>
Description: Utilities to interact with the R-universe platform. Includes functions to manage local package repositories, as well as API wrappers for retrieving data and metadata about packages in r-universe.
Authors: Jeroen Ooms [aut, cre] (ORCID: <https://orcid.org/0000-0002-4035-0289>), Maëlle Salmon [aut] (ORCID: <https://orcid.org/0000-0002-2815-0399>)
Maintainer: Jeroen Ooms <[email protected]>
License: Apache License (>= 2)
Version: 1.0.0.9000
Built: 2026-02-20 06:30:57 UTC
Source: https://github.com/ropensci/universe

Help Index


Enable a package repository from r-universe

Description

Adds r-universe package repositories to your options("repos") such that they are used by default in install.packages(). If the universe was already enabled, it will not be added again, hence it is harmless to call this function multiple times.

Usage

add(universe = "ropensci")

remove(universe)

Arguments

universe

vector with name(s) of the universe(s), i.e. the subdomain part of ⁠https://ropensci.r-universe.dev⁠.

Details

Note that changes to your options are not permanent. To automatically enable a repository for every R session, you can call this function in your ~/.Rprofile script.

Value

the updated list of repositories

Examples

add("ropensci")

All universes

Description

All universes

Usage

everyone(type = c("all", "universes", "maintainers"))

Arguments

type

Type of universe to query: "all", only organizations ("universe"), personal accounts ("maintainer").

Value

A character vector of all universes.

Examples

head(everyone())

Download snapshot

Description

Downloads a full copy (snapshot) of an R package repository.

Usage

repo_snapshot(
  repo,
  destdir = NULL,
  types = c("src", "win", "mac", "linux", "wasm", "docs"),
  bin_versions = r_version(),
  verbose = interactive()
)

r_version()

Arguments

repo

url of the cran-like repository to snapshot

destdir

path to directory where to save the snapshots

types

which files to include. Must be subset of "src", "win", "mac", "linux", "wasm", "docs".

bin_versions

vector with versions of R to download binary packages. Set to NULL to download all binaries available.

verbose

print some progress

Value

None, used for its side-effects.

Examples

repo_snapshot("https://jeroen.r-universe.dev")

Info on all packages in an universe

Description

Info on all packages in an universe

Usage

universe_all_packages(universe, limit = 100L)

Arguments

universe

Name of the universe (character of length 1)

limit

Number of results to return (integer of length 1)

Value

A list with information on all packages in the universe.

See Also

Other universe: universe_ls(), universe_one_package(), universe_search()

Examples

universe_all_packages("jeroen")
universe_all_packages("ropensci")

All packages in an universe

Description

All packages in an universe

Usage

universe_ls(universe)

Arguments

universe

Name of the universe (character of length 1)

Value

A character vector of all packages in the universe.

See Also

Other universe: universe_all_packages(), universe_one_package(), universe_search()

Examples

universe_ls("jeroen")
universe_ls("ropensci")

Info on a single packages in an universe

Description

Info on a single packages in an universe

Usage

universe_one_package(universe, package)

Arguments

universe

Name of the universe (character of length 1)

package

Name of the package (character of length 1)

Value

A list with information on the package.

See Also

Other universe: universe_all_packages(), universe_ls(), universe_search()

Examples

universe_one_package("jeroen", package = "curl")

Create packages.json for existing universe

Description

Create packages.json for existing universe

Usage

use_custom_manifest(universe, path = "packages.json")

Arguments

universe

Name of the universe, e.g. "jeroen"

path

Absolute path to which the JSON file could be saved.

Value

The path to the JSON file it created.

Examples

json_file <- withr::local_tempfile()
use_custom_manifest("jeroen", json_file)
file.edit(json_file)

Use R-universe GitHub Actions workflow

Description

Test the R-universe build workflow from your own GitHub repository

Usage

use_universe_action(universe = NULL, path = ".")

Arguments

universe

Universe to set the context to, by default the owner of the repository. This affects where R package dependencies are downloaded from (besides the default repositories).

path

Path to the local repository for which you want to use the workflow.

Value

The path to the workflow

Examples

temp_dir <- withr::local_tempdir()
workflow_path <- use_universe_action("maelle", temp_dir)
file.edit(workflow_path)