install | R Documentation |
Install one or more R packages, from a variety of remote sources.
install()
uses the same machinery as restore()
(i.e. it uses cached
packages where possible) but it does not respect the lockfile, instead
installing the latest versions available from CRAN.
See vignette("package-install")
for more details.
install(
packages = NULL,
...,
exclude = NULL,
library = NULL,
type = NULL,
rebuild = FALSE,
repos = NULL,
prompt = interactive(),
dependencies = NULL,
verbose = NULL,
lock = FALSE,
project = NULL
)
packages |
Either
See https://remotes.r-lib.org/articles/dependencies.html and the examples below for more details. renv deviates from the remotes spec in one important way: subdirectories
are separated from the main repository specification with a |
... |
Unused arguments, reserved for future expansion. If any arguments
are matched to |
exclude |
Packages which should not be installed. |
library |
The R library to be used. When |
type |
The type of package to install ("source" or "binary"). Defaults
to the value of |
rebuild |
Force packages to be rebuilt, thereby bypassing any installed versions of the package available in the cache? This can either be a boolean (indicating that all installed packages should be rebuilt), or a vector of package names indicating which packages should be rebuilt. |
repos |
The repositories to use when restoring packages installed from CRAN or a CRAN-like repository. By default, the repositories recorded in the lockfile will be used, ensuring that (e.g.) CRAN packages are re-installed from the same CRAN mirror. Use |
prompt |
Boolean; prompt the user before taking any action? For backwards
compatibility, |
dependencies |
A vector of DESCRIPTION field names that should be used
for package dependency resolution. When |
verbose |
Boolean; report output from |
lock |
Boolean; update the |
project |
The project directory. If |
A named list of package records which were installed by renv.
Remotes
install()
(called without arguments) will respect the Remotes
field
of the DESCRIPTION
file (if present). This allows you to specify places
to install a package other than the latest version from CRAN.
See https://remotes.r-lib.org/articles/dependencies.html for details.
Packages from Bioconductor can be installed by using the bioc::
prefix.
For example,
renv::install("bioc::Biobase")
will install the latest-available version of Biobase from Bioconductor.
renv depends on BiocManager (or, for older versions of R, BiocInstaller) for the installation of packages from Bioconductor. If these packages are not available, renv will attempt to automatically install them before fulfilling the installation request.
## Not run:
# install the latest version of 'digest'
renv::install("digest")
# install an old version of 'digest' (using archives)
renv::install("digest@0.6.18")
# install 'digest' from GitHub (latest dev. version)
renv::install("eddelbuettel/digest")
# install a package from GitHub, using specific commit
renv::install("eddelbuettel/digest@df55b00bff33e945246eff2586717452e635032f")
# install a package from Bioconductor
# (note: requires the BiocManager package)
renv::install("bioc::Biobase")
# install a package, specifying path explicitly
renv::install("~/path/to/package")
# install packages as declared in the project DESCRIPTION file
renv::install()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.