knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Tools for Working with R-universe and its APIs.

Installation and docs

You can install the development version of universe from r-universe:

install.packages("universe", repos = "https://ropensci.r-universe.dev")

Or the development version of universe from GitHub with:

# install.packages("pak")
pak::pak("ropensci/universe")

Documentation is available on https://docs.ropensci.org/universe.

Enable a repository

Use runiverse::add() to opt-in to a package repository (this will modify your options('repos') list).

# Install a package from r-universe
universe::add("ropensci")
install.packages("magick")

For more details see the documentation for runiverse::add().

Get data from the APIs

All packages in an universe

library(universe)
universe_ls("jeroen")

Info on all packages in an universe

universe_all_packages("jeroen", limit = 1) |>
  str(max.level = 2)

Info on a single package in an universe

universe_one_package("jeroen", package = "curl") |>
  str(max.level = 1)

Search within a single universe

universe_search("ropensci", query = 'needs:httr2', limit = 1) |>
  str(max.level = 2)

Search among all universes

global_search(query = '"weather data"', limit = 1) |>
  str(max.level = 2)


ropensci/universe documentation built on Feb. 8, 2025, 3:20 p.m.