knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

rspmapi

The rspmapi package implements an R wrapper around the RStudio Package Manager API.

Installation

You can install the development version of rspmapi from GitHub with:

# install.packages("devtools")
devtools::install_github("sellorm/rspmapi")

Example

In order to use any of the supplied functions, you must first connect to your Package Manager instance:

library(rspmapi)
rspm <- instance("https://packagemanager.rstudio.com")

Once you have an RSPM instance object, you can use it to perform API operations.

Each API endpoint has a corresponding function in rspmapi.

result <- rspm %>% 
  status()
result$version

Some of the functions take additional arguments:

result <- rspm %>% 
  repos_sources(id = 1)
result[[1]]$created

Some functions can optionally take additional query string parameters. These are documented in the RSPM API docs for each API call.

params <- list(`_limit` = 5, `_page` = 2, name_like = "shiny")
result <- rspm %>% 
  sources_packages(id = 1, params = params)
unlist(lapply(result, function(x){x$name}))


sellorm/rspmapi documentation built on April 14, 2022, 11:58 a.m.