This function knows how to look in multiple CRAN-like package repositories, and in their
archive directories, in order to find specific versions of the requested package.
install_version( package, version = NULL, dependencies = NA, upgrade = c("default", "ask", "always", "never"), force = FALSE, quiet = FALSE, build = FALSE, build_opts = c("--no-resave-data", "--no-manual", "--no-build-vignettes"), build_manual = FALSE, build_vignettes = FALSE, repos = getOption("repos"), type = "source", ... )
| package | Name of the package to install. |
|---|---|
| version | Version of the package to install. Can either be a string giving the exact version required, or a specification in the same format as the parenthesized expressions used in package dependencies. One of the following formats:
|
| dependencies | logical indicating whether to also install
uninstalled packages which these packages depend on/link
to/import/suggest (and so on recursively).
Not used if Only supported if The default,
In all of these, |
| upgrade | One of "default", "ask", "always", or "never". "default"
respects the value of the |
| force | Force installation, even if the remote state has not changed since the previous install. |
| quiet | logical: if true, reduce the amount of output. This is not
passed to |
| build | If |
| build_opts | Options to pass to |
| build_manual | If |
| build_vignettes | If |
| repos | character vector, the base URL(s) of the repositories
to use, e.g., the URL of a CRAN mirror such as
Can be |
| type | character, indicating the type of package to download and
install. Will be |
| ... | Other arguments passed on to |
The repositories are searched in the order specified by the repos argument. This enables
teams to maintain multiple in-house repositories with different policies - for instance, one repo
for development snapshots and one for official releases. A common setup would be to first search
the official release repo, then the dev snapshot repo, then a public CRAN mirror.
Older versions of packages on CRAN are usually only available in source form. If your requested
package contains compiled code, you will need to have an R development environment installed. You
can check if you do by running devtools::has_devel (you need the devtools package for this).
Other package installation:
install_bioc(),
install_bitbucket(),
install_cran(),
install_dev(),
install_github(),
install_gitlab(),
install_git(),
install_local(),
install_svn(),
install_url()
if (FALSE) { install_version("devtools", "1.11.0") install_version("devtools", ">= 1.12.0, < 1.14") ## Specify search order (e.g. in ~/.Rprofile) options(repos = c( prod = "http://mycompany.example.com/r-repo", dev = "http://mycompany.example.com/r-repo-dev", CRAN = "https://cran.revolutionanalytics.com" )) install_version("mypackage", "1.15") # finds in 'prod' install_version("mypackage", "1.16-39487") # finds in 'dev' }