Skip to contents

The BiocManager::install() function installs or updates Bioconductor and CRAN packages in a Bioconductor release. Upgrading to a new Bioconductor release may require additional steps; see https://bioconductor.org/install.

Usage

install(
  pkgs = character(),
  ...,
  site_repository = character(),
  update = TRUE,
  ask = TRUE,
  checkBuilt = FALSE,
  force = FALSE,
  version = BiocManager::version()
)

Arguments

pkgs

character() vector of package names to install or update. A missing value updates installed packages according to update = and ask =. Package names containing a '/' are treated as GitHub repositories and installed using remotes::install_github().

...

Additional arguments used by install.packages().

site_repository

(Optional) character(1) vector representing an additional repository in which to look for packages to install. This repository will be prepended to the default repositories (which you can see with BiocManager::repositories()).

update

logical(1). When FALSE, BiocManager::install() does not attempt to update old packages. When TRUE, update old packages according to ask.

ask

logical(1) indicating whether to prompt user before installed packages are updated. If TRUE, user can choose whether to update all outdated packages without further prompting, to pick packages to update, or to cancel updating (in a non-interactive session, no packages will be updated unless ask = FALSE).

checkBuilt

logical(1). If TRUE a package built under an earlier major.minor version of R (e.g., 3.4) is considered to be old.

force

logical(1). If TRUE re-download a package that is currently up-to-date.

version

character(1) Bioconductor version to install, e.g., version = "3.8". The special symbol version = "devel" installs the current 'development' version.

Value

BiocManager::install() returns the pkgs argument, invisibly.

Details

Installation of Bioconductor and CRAN packages use R's standard functions for library management – install.packages(), available.packages(), update.packages(). Installation of GitHub packages uses the remotes::install_github().

When installing CRAN or Bioconductor packages, typical arguments include: lib.loc, passed to old.packages() and used to determine the library location of installed packages to be updated; and lib, passed to install.packages{} to determine the library location where pkgs are to be installed.

When installing GitHub packages, ... is passed to the remotes package functions install_github() and remotes:::install(). A typical use is to build vignettes, via dependencies=TRUE, build_vignettes=TRUE.

See ?repositories for additional detail on customizing where BiocManager searches for package installation.

BIOCONDUCTOR_ONLINE_VERSION_DIAGNOSIS is an environment variable or global options() which, when set to FALSE, allows organizations and its users to use offline repositories with BiocManager while enforcing appropriate version checks between Bioconductor and R. Setting BIOCONDUCTOR_ONLINE_VERSION_DIAGNOSIS to FALSE can speed package loading when internet access is slow or non-existent, but may result in out-of-date information regarding the current release and development versions of Bioconductor. In addition, offline organizations and its users should set the BIOCONDUCTOR_CONFIG_FILE environment variable or option to a .yaml file similar to https://bioconductor.org/config.yaml for full offline use and version validation.

See also

BiocManager::repositories() returns the Bioconductor and CRAN repositories used by install().

install.packages() installs the packages themselves (used by BiocManager::install internally).

update.packages() updates all installed packages (used by BiocManager::install internally).

chooseBioCmirror() allows choice of a mirror from all public Bioconductor mirrors.

chooseCRANmirror() allows choice of a mirror from all public CRAN mirrors.

Examples


if (FALSE) { # \dontrun{
## update previously installed packages
BiocManager::install()

## install Bioconductor packages, and prompt to update all
## installed packages
BiocManager::install(c("GenomicRanges", "edgeR"))

## install a CRAN and Bioconductor packages:
BiocManager::install(c("survival", "SummarizedExperiment"))

## install a package from source:
BiocManager::install("IRanges", type="source")
} # }