Learn R Programming

switchr (version 0.14.8)

install_packages: install_packages

Description

Install packages from a set of traditional repositories, or a Just-in-time repository constructed using a PkgManifest or SessionManifest

Usage

install_packages(pkgs, repos, versions = NULL, verbose = FALSE, ...)

# S4 method for character,character install_packages(pkgs, repos, versions = NULL, verbose = FALSE, ...)

# S4 method for character,missing install_packages(pkgs, repos, versions = NULL, verbose = FALSE, ...)

# S4 method for SessionManifest,ANY install_packages(pkgs, repos, versions = NULL, verbose = FALSE, ...)

# S4 method for character,SessionManifest install_packages(pkgs, repos, versions = NULL, verbose = FALSE, ...)

# S4 method for character,PkgManifest install_packages(pkgs, repos, versions = NULL, verbose = FALSE, ...)

Value

a vector of names of the packages installed.

Arguments

pkgs

The names of the packages to install

repos

The (generalized) repositor(ies) to install the packages from. Can be a character vector of traditional package repositories (as with install.packages) or a PkgManifest or SessionManifest (or a url thereof)

versions

An optional named character vector or data.frame specifying exact versions of the packages to install

verbose

Should extra information be printed during the console during installation

...

extra parameters passed directly to install.packages

Author

Gabriel Becker

Details

In addition to installing the specified packages, this function annotates the installed DESCRIPTION files with provenance information about where the packages were installed from. This retains the information necessary to generate a manifest of installed packages for publication or reinstallation.

When repos is a vector of traditional repositories, this function - with the exception of the provenance mentioned above - behaves identically to install.packages. Otherwise, a Just-in-Time package repository is constructed using the information in the manifest(s) passed to repos, which is then used in conjuction with link{install.packages} to do the actual installation.

References

Becker G, Barr C, Gentleman R, Lawrence M; Enhancing Reproducibility and Collaboration via Management of R Package Cohorts. Journal of Statistical Software, 81(1). 2017. doi: 10.18637/jss.v082.i01

Examples

Run this code
if (FALSE) {
## equivalent to install.packages, except it stores
## package provenance and knows about bioconductor repos
install_packages("nlme")

## install from a manifest
man = GithubManifest("gmbecker/fastdigest")
install_packages("fastdigest", man)

## install a full seeding manifest
man2 = makeSeedMan("myotherlib")
install_packages(man2)
}

Run the code above in your browser using DataLab