Install one or more R packages.
install(packages, project = NULL, library = NULL)
A character vector of R packages to install. Required
package dependencies (Depends
, Imports
, LinkingTo
) will be installed
as required.
The project directory. If NULL
, then the active
project will be used. If no project has been specifically activated,
the current working directory is used.
The library from which packages should be installed. When
NULL
, the active library (that is, the first entry reported in
.libPaths()
) is used instead.
install()
uses the same machinery as restore()
when installing packages.
In particular, this means that the local cache of package installations is
used when possible. This helps to avoid re-downloading packages that have
already been downloaded before, and re-compiling packages from source when
a binary copy of that package is already available.
Note that this interface is subject to change -- the goal is to hook into separate package installation backends in the future.