repo_get {pkgcache}R Documentation

Query and set the list of CRAN-like repositories

Description

pkgcache uses the repos option, see options(). It also automatically uses the current Bioconductor repositories, see bioc_version(). These functions help to query and manipulate the repos option.

Usage

repo_get(
  r_version = getRversion(),
  bioc = TRUE,
  cran_mirror = default_cran_mirror()
)

repo_resolve(spec)

repo_add(..., .list = NULL)

with_repo(repos, expr)

Arguments

r_version

R version(s) to use for the Bioconductor repositories, if bioc is TRUE.

bioc

Whether to add Bioconductor repositories, even if they are not configured in the repos option.

cran_mirror

The CRAN mirror to use, see default_cran_mirror().

spec

A single repository specification, a possibly named character scalar. See details below.

...

Repository specifications. See details below.

.list

List or character vector of repository specifications, see details below.

repos

A list or character vector of repository specifications.

expr

R expression to evaluate.

Details

repo_get() queries the repositories pkgcache uses. It uses the repos option (see options), and also the default Bioconductor repository.

repo_resolve() resolves a single repository specification to a repository URL.

repo_add() adds a new repository to the repos option. (To remove a repository, call option() directly, with the subset that you want to keep.)

with_repo() temporarily adds the repositories in repos, evaluates expr, and then resets the configured repositories.

Value

repo_get() returns a data frame with columns:

repo_resolve() returns a named character vector, with the URL(s) of the repository.

repo_add() returns the same data frame as repo_get(), invisibly.

with_repo() returns the value of expr.

Repository specifications

The format of a repository specification is a named or unnamed character scalar. If the name is missing, pkgcache adds a name automatically. The repository named CRAN is the main CRAN repository, but otherwise names are informational.

Currently supported repository specifications:

Still works for dates starting from 2017-10-10, but now deprecated, because MRAN is discontinued:

Notes:

See Also

Other repository functions: repo_status()

Examples

repo_get()

repo_resolve("PPM@2020-01-21")
#' repo_resolve("PPM@dplyr-1.0.0")
#' repo_resolve("PPM@R-4.0.0")


with_repo(c(CRAN = "PPM@dplyr-1.0.0"), repo_get())
with_repo(c(CRAN = "PPM@dplyr-1.0.0"), meta_cache_list(package = "dplyr"))

with_repo(c(CRAN = "MRAN@2018-06-30"), summary(repo_status()))


[Package pkgcache version 2.2.2 Index]