If you are installing an package that 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).
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
If the specified version is NULL or the same as the most
recent version of the package, this function simply calls
utils::install.packages()
. Otherwise, it looks at the list of
archived source tarballs and tries to install an older version instead.
logical indicating whether to also install
uninstalled packages which these packages depend on/link
to/import/suggest (and so on recursively).
Not used if repos = NULL
.
Can also be a character vector, a subset of
c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")
.
Only supported if lib
is of length one (or missing),
so it is unambiguous where to install the dependent packages. If
this is not the case it is ignored, with a warning.
The default, NA
, means
c("Depends", "Imports", "LinkingTo")
.
TRUE
means to use
c("Depends", "Imports", "LinkingTo", "Suggests")
for
pkgs
and
c("Depends", "Imports", "LinkingTo")
for added dependencies:
this installs all the packages needed to run pkgs
, their
examples, tests and vignettes (if the package author specified them
correctly).
In all of these, "LinkingTo"
is omitted for binary packages.
One of "default", "ask", "always", or "never". "default"
respects the value of the R_REMOTES_UPGRADE
environment variable if set,
and falls back to "ask" if unset. "ask" prompts the user for which out of
date packages to upgrade. For non-interactive sessions "ask" is equivalent
to "always". TRUE
and FALSE
are also accepted and correspond to
"always" and "never" respectively.
Force installation, even if the remote state has not changed since the previous install.
logical: if true, reduce the amount of output.
If TRUE
build the package before installing.
Options to pass to R CMD build
, only used when build
If FALSE
, don't build PDF manual ('--no-manual').
If FALSE
, don't build package vignettes ('--no-build-vignettes').
is TRUE
.
character vector, the base URL(s) of the repositories
to use, e.g., the URL of a CRAN mirror such as
"https://cloud.r-project.org"
. For more details on
supported URL schemes see url
.
Can be NULL
to install from local files, directories or URLs:
this will be inferred by extension from pkgs
if of length one.
character, indicating the type of package to download and
install. Will be "source"
except on Windows and some macOS
builds: see the section on ‘Binary packages’ for those.
Other arguments passed on to utils::install.packages()
.
Other package installation: install_bioc
,
install_bitbucket
,
install_cran
, install_dev
,
install_github
,
install_gitlab
, install_git
,
install_local
, install_svn
,
install_url