Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

repositories

Display current Bioconductor and CRAN repositories.


Description

repositories() reports the URLs from which to install Bioconductor and CRAN packages. It is used by BiocManager::install() and other functions.

Usage

repositories(site_repository = character(), version = BiocManager::version())

Arguments

site_repository

(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.

version

(Optional) character(1) or package_version indicating the Bioconductor version (e.g., "3.8") for which repositories are required.

Details

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.

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.

Value

Named character() of repositories.

See Also

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.

Examples

BiocManager::repositories()
## Not run: 
BiocManager::repositories(version="3.8")

## End(Not run)

BiocManager

Access the Bioconductor Project Package Repository

v1.30.15
Artistic-2.0
Authors
Martin Morgan [aut] (<https://orcid.org/0000-0002-5874-8148>), Marcel Ramos [ctb, cre] (<https://orcid.org/0000-0002-3242-0582>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.