repo_get {pkgcache} | R Documentation |
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.
repo_get(
r_version = getRversion(),
bioc = TRUE,
cran_mirror = default_cran_mirror()
)
repo_resolve(spec)
repo_add(..., .list = NULL)
with_repo(repos, expr)
r_version |
R version(s) to use for the Bioconductor repositories,
if |
bioc |
Whether to add Bioconductor repositories, even if they
are not configured in the |
cran_mirror |
The CRAN mirror to use, see
|
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. |
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.
repo_get()
returns a data frame with columns:
name
: repository name. Names are informational only.
url
: repository URL.
type
: repository type. This is also informational, currently it
can be cran
for CRAN, bioc
for a Bioconductor repository, and
cranlike
: for other repositories.
r_version
: R version that is supposed to be used with this
repository. This is only set for Bioconductor repositories. It is *
for others. This is also informational, and not used when retrieving
the package metadata.
bioc_version
: Bioconductor version. Only set for Bioconductor
repositories, and it is NA
for others.
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
.
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:
URL pointing to the root of the CRAN-like repository. Example:
https://cloud.r-project.org
RSPM@<date>
, RSPM (RStudio Package Manager) snapshot, at the
specified date.
RSPM@<package>-<version>
RSPM snapshot, for the day after the
release of <version>
of <package>
.
RSPM@R-<version>
RSPM snapshot, for the day after R <version>
was released.
MRAN@<date>
, MRAN (Microsoft R Application Network) snapshot, at
the specified date.
MRAN@<package>-<version>
MRAN snapshot, for the
day after the release of <version>
of <package>
.
MRAN@R-<version>
MRAN snapshot, for the day
after R <version>
was released.
Notes:
See more about RSPM at https://packagemanager.rstudio.com/client/#/.
See more about MRAN snapshots at https://mran.microsoft.com/timemachine.
All dates (or times) can be specified in the ISO 8601 format.
If RSPM does not have a snapshot available for a date, the next available date is used.
Dates that are before the first, or after the last RSPM snapshot will trigger an error.
Dates before the first, or after the last MRAN snapshot will trigger an error.
Unknown R or package versions will trigger an error.
Other repository functions:
repo_status()
repo_get()
repo_resolve("MRAN@2020-01-21")
repo_resolve("RSPM@2020-01-21")
repo_resolve("MRAN@dplyr-1.0.0")
repo_resolve("RSPM@dplyr-1.0.0")
repo_resolve("MRAN@R-4.0.0")
repo_resolve("RSPM@R-4.0.0")
with_repo(c(CRAN = "RSPM@dplyr-1.0.0"), repo_get())
with_repo(c(CRAN = "RSPM@dplyr-1.0.0"), meta_cache_list(package = "dplyr"))
with_repo(c(CRAN = "MRAN@2018-06-30"), summary(repo_status()))