| 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 |
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.
add(universe = "ropensci") remove(universe)add(universe = "ropensci") remove(universe)
universe |
vector with name(s) of the universe(s), i.e. the subdomain
part of |
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.
the updated list of repositories
add("ropensci")add("ropensci")
All universes
everyone(type = c("all", "universes", "maintainers"))everyone(type = c("all", "universes", "maintainers"))
type |
Type of universe to query: "all", only organizations ("universe"), personal accounts ("maintainer"). |
A character vector of all universes.
head(everyone())head(everyone())
Search among all universes
global_search(query, limit = 100L)global_search(query, limit = 100L)
query |
Query string. See R-universe docs. |
limit |
Number of results to return (integer of length 1) |
A list with query results. The total field indicates the
total number of results and can be used as limit value in a second call.
global_search(query = '"weather data"', limit = 1) global_search(query = 'needs:httr2', limit = 1)global_search(query = '"weather data"', limit = 1) global_search(query = 'needs:httr2', limit = 1)
Downloads a full copy (snapshot) of an R package repository.
repo_snapshot( repo, destdir = NULL, types = c("src", "win", "mac", "linux", "wasm", "docs"), bin_versions = r_version(), verbose = interactive() ) r_version()repo_snapshot( repo, destdir = NULL, types = c("src", "win", "mac", "linux", "wasm", "docs"), bin_versions = r_version(), verbose = interactive() ) r_version()
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 |
None, used for its side-effects.
repo_snapshot("https://jeroen.r-universe.dev")repo_snapshot("https://jeroen.r-universe.dev")
Info on all packages in an universe
universe_all_packages(universe, limit = 100L)universe_all_packages(universe, limit = 100L)
universe |
Name of the universe (character of length 1) |
limit |
Number of results to return (integer of length 1) |
A list with information on all packages in the universe.
Other universe:
universe_ls(),
universe_one_package(),
universe_search()
universe_all_packages("jeroen") universe_all_packages("ropensci")universe_all_packages("jeroen") universe_all_packages("ropensci")
All packages in an universe
universe_ls(universe)universe_ls(universe)
universe |
Name of the universe (character of length 1) |
A character vector of all packages in the universe.
Other universe:
universe_all_packages(),
universe_one_package(),
universe_search()
universe_ls("jeroen") universe_ls("ropensci")universe_ls("jeroen") universe_ls("ropensci")
Info on a single packages in an universe
universe_one_package(universe, package)universe_one_package(universe, package)
universe |
Name of the universe (character of length 1) |
package |
Name of the package (character of length 1) |
A list with information on the package.
Other universe:
universe_all_packages(),
universe_ls(),
universe_search()
universe_one_package("jeroen", package = "curl")universe_one_package("jeroen", package = "curl")
Search within a single universe
universe_search(universe, query, limit = 100L)universe_search(universe, query, limit = 100L)
universe |
Name of the universe (character of length 1) |
query |
Query string. See R-universe docs. |
limit |
Number of results to return (integer of length 1) |
A list with query results. The total field indicates the
total number of results and can be used as limit value in a second call.
Other universe:
universe_all_packages(),
universe_ls(),
universe_one_package()
universe_search("ropensci", query = '"weather data"') universe_search("ropensci", query = 'needs:httr2')universe_search("ropensci", query = '"weather data"') universe_search("ropensci", query = 'needs:httr2')
packages.json for existing universeCreate packages.json for existing universe
use_custom_manifest(universe, path = "packages.json")use_custom_manifest(universe, path = "packages.json")
universe |
Name of the universe, e.g. "jeroen" |
path |
Absolute path to which the JSON file could be saved. |
The path to the JSON file it created.
json_file <- withr::local_tempfile() use_custom_manifest("jeroen", json_file) file.edit(json_file)json_file <- withr::local_tempfile() use_custom_manifest("jeroen", json_file) file.edit(json_file)
Test the R-universe build workflow from your own GitHub repository
use_universe_action(universe = NULL, path = ".")use_universe_action(universe = NULL, path = ".")
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. |
The path to the workflow
temp_dir <- withr::local_tempdir() workflow_path <- use_universe_action("maelle", temp_dir) file.edit(workflow_path)temp_dir <- withr::local_tempdir() workflow_path <- use_universe_action("maelle", temp_dir) file.edit(workflow_path)