Skip to contents

Install packages from Bioconductor, CRAN, or a Git remote

Usage

install(pkgs, dependencies = NA, lib = .libPaths()[[1L]], reinstall = TRUE)

Arguments

pkgs

character. Package names to install. By default, strings are passed to BiocManager::install().

Special cases:

  • Package tarball files and remote URLs (i.e. from CRAN or Bioconductor) are supported.

  • Strings matching "USER/REPO" are treated as GitHub repositories, and installed using remotes::install_github().

  • Strings ending with ".git" are treated as Git repositories, and installed using remotes::install_git().

dependencies

logical(1), character, or NA.

  • TRUE/FALSE indicating whether to install uninstalled packages which these packages depend on/link to/import/suggest.

  • Can pass a character vector, a subset of c("Depends", "Imports", " LinkingTo", "Suggests", "Enhances").

  • Can pass NA, the default for install.packages(), which means c("Depends", "Imports", "LinkingTo").

lib

character. Destination library directory path. Defaults to the first element of .libPaths().

reinstall

logical(1). Force reinstallation of any existing packages.

Value

Invisible list. Contains information on pkgs and lib defined.

Note

Updated 2022-05-31.

Examples

## > testlib <- file.path(tempdir(), "testlib")
## > unlink(testlib, recursive = TRUE)
## > out <- install(
## >     pkgs = "BiocGenerics",
## >     dependencies = FALSE,
## >     lib = file.path(tempdir(), "testlib")
## > )
## > print(out)
## > list.dirs(path = testlib, full.names = FALSE, recursive = FALSE)
## > unlink(testlib, recursive = TRUE)