Skip to content

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.


  packages = NULL,
  exclude = NULL,
  library = NULL,
  type = NULL,
  rebuild = FALSE,
  repos = NULL,
  prompt = interactive(),
  dependencies = NULL,
  project = NULL



Either NULL (the default) to install all packages required by the project, or a character vector of packages to install. renv supports a subset of the remotes syntax used for package installation, e.g:

  • pkg: install latest version of pkg from CRAN.

  • pkg@version: install specified version of pkg from CRAN.

  • username/repo: install package from GitHub

  • bioc::pkg: install pkg from Bioconductor.

See 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 :, not /. So to install from the subdir subdirectory of GitHub package username/repo you'd use "username/repo:subdir.


Unused arguments, reserved for future expansion. If any arguments are matched to ..., renv will signal an error.


Packages which should not be installed. exclude is useful when using renv::install() to install all dependencies in a project, except for a specific set of packages.


The R library to be used. When NULL, the active project library will be used instead.


The type of package to install ("source" or "binary"). Defaults to the value of getOption("pkgType").


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.


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, ensuring that (e.g.) CRAN packages are re-installed from the same CRAN mirror.

Use repos = getOptions(repos) to override with the repositories set in the current session, or see the repos.override option in config for an alternate way override.


Boolean; prompt the user before taking any action? For backwards compatibility, confirm is accepted as an alias for prompt.


A vector of DESCRIPTION field names that should be used for package dependency resolution. When NULL (the default), the value of renv::settings$package.dependency.fields is used. The aliases "strong", "most", and "all" are also supported. See tools::package_dependencies() for more details.


The project directory. If NULL, then the active project will be used. If no project is currently active, then the current working directory is used instead.


A named list of package records which were installed by renv.


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 for details.


Packages from Bioconductor can be installed by using the bioc:: prefix. For example,


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.


if (FALSE) {

# install the latest version of 'digest'

# install an old version of 'digest' (using archives)

# install 'digest' from GitHub (latest dev. version)

# install a package from GitHub, using specific commit

# install a package from Bioconductor
# (note: requires the BiocManager package)

# install a package, specifying path explicitly

# install packages as declared in the project DESCRIPTION file