repositories()
reports the URLs from which to
install Bioconductor and CRAN packages. It is used by
BiocManager::install()
and other functions.
containerRepository()
reports the location of the repository
of binary packages for fast installation within containerized versions
of Bioconductor, if available.
repositories(site_repository = character(), version = BiocManager::version())containerRepository(version = BiocManager::version())
repositories()
: named character()
of repositories.
containerRepository()
: character(1) location of binary repository,
if available, or character(0) if not.
(Optional) character(1)
representing an
additional repository (e.g., a URL to an organization's
internally maintained repository) in which to look for packages
to install. This repository will be prepended to the default
repositories returned by the function.
(Optional) character(1)
or package_version
indicating the Bioconductor version (e.g., "3.8") for which
repositories are required.
repositories()
returns the appropriate software package
repositories for your version of Bioconductor.
Bioconductor has a 'release' and a 'devel' semi-annual release cycle. Packages within a release have been tested against each other and the current version of packages on CRAN. Bioconductor best practice is to use packages from the same release, and from the appropriate CRAN repository.
CRAN packages for out-of-date Bioconductor installations can be
installed from historical 'snapshots' consistent with the last date
the Bioconductor version was current. This behavior can be specified with
BiocManager.snapshot
For example, Bioconductor version 3.11 was current
until October 28, 2020; CRAN packages are therefore installed from
a snapshot created on 2020-10-28. By default, the snapshots are
from 'MRAN', the Microsoft R Archive Network. Use
options(BiocManager.snapshot = "RSPM")
to instead use the
RStudio Package Manager, or options(BiocManager.snapshot = "CRAN")
to use the current CRAN repository (i.e., disabling the
snapshot feature).
It may be desirable to specify different default repositories,
especially CRAN, for intentionally out-of-date Bioconductor
releases (e.g., to support reproducible research). Use the approach
provided by base R to specify alternative repositories, e.g.,
options(repos = c(CRAN = "https://mran.microsoft.com/snapshot/2020-02-08"))
. This is
supported, but generates an error because specification of an
inappropriate CRAN repository (one providing packages not
consistent with the dates of the Bioconductor release) results in
use of CRAN packages not consistent with Bioconductor best
practices.
To install binary packages on containerized versions of Bioconductor,
a default binary package location URL is set as a package constant,
see BiocManager:::BINARY_BASE_URL
. Binary package installations
are enabled by default for Bioconductor Docker containers. Anyone
wishing to opt out of the binary package installation can set either the
variable or the option, BIOCONDUCTOR_USE_CONTAINER_REPOSITORY
, to
FALSE
. Note that the availability of Bioconductor package binaries is
experimental and binary installations are intended to be used with
bioconductor/bioconductor_docker
images where such installations
correspond to specific versions of Linux / Ubuntu.
If alternative default repositories are known to provide
appropriate versions of CRAN or Bioconductor packages, the warning
may be silenced (displayed as a message) with
options(BiocManager.check_repositories = FALSE)
. A message is
still printed, to serve as a reminder when debugging problems
related to incompatible package installation.
The intended use of site_repository =
is to enable installation of
packages not available in the default repositories, e.g., packages
internal to an organization and not yet publicly available. A
secondary use might provide alternative versions (e.g., compiled
binaries) of packages available in the default repositories. Note
that R's standard rules of package selection apply, so the most
recent version of candidate packages is selected independent of the
location of the repository in the vector returned by repositories()
.
For greater flexiblity in installing packages while still adhering
as much as possible to Bioconductor best practices, use
repositories()
as a basis for constructing the repos =
argument
to install.packages()
and related functions.
The unexported URL to the base repository is available with
BiocManager:::BINARY_BASE_URL
.
BIOCONDUCTOR_USE_CONTAINER_REPOSITORY
is an environment
variable or global options()
which, when set to FALSE
, avoids
the fast installation of binary packages within containerized
versions of Bioconductor.
BiocManager::\link{install}()
Installs or updates Bioconductor,
CRAN, and GitHub packages.
\link{chooseBioCmirror}()
choose an alternative Bioconductor
mirror; not usually necessary.
\link{chooseCRANmirror}()
choose an alternative CRAN mirror; not
usually necessary.
\link{setRepositories}()
Select additional repositories for
searching.
BiocManager::repositories()
if (FALSE) {
BiocManager::repositories(version="3.8")
}
containerRepository() # character(0) if not within a Bioconductor container
Run the code above in your browser using DataLab