Learn R Programming

devtools (version 1.13.6)

install: Install a local development package.

Description

Uses R CMD INSTALL to install the package. Will also try to install dependencies of the package from CRAN, if they're not already installed.

Usage

install(pkg = ".", reload = TRUE, quick = FALSE, local = TRUE,
  args = getOption("devtools.install.args"), quiet = FALSE,
  dependencies = NA, upgrade_dependencies = TRUE, build_vignettes = FALSE,
  keep_source = getOption("keep.source.pkgs"), threads = getOption("Ncpus",
  1), force_deps = FALSE, metadata = remote_metadata(as.package(pkg)),
  out_dir = NULL, skip_if_log_exists = FALSE, ...)

Arguments

pkg

package description, can be path or package name. See as.package for more information

reload

if TRUE (the default), will automatically reload the package after installing.

quick

if TRUE skips docs, multiple-architectures, demos, and vignettes, to make installation as fast as possible.

local

if FALSE builds the package first: this ensures that the installation is completely clean, and prevents any binary artefacts (like .o, .so) from appearing in your local package directory, but is considerably slower, because every compile has to start from scratch.

args

An optional character vector of additional command line arguments to be passed to R CMD install. This defaults to the value of the option "devtools.install.args".

quiet

if TRUE suppresses output from this function.

dependencies

logical indicating to also install uninstalled packages which this pkg depends on/links to/suggests. See argument dependencies of install.packages.

upgrade_dependencies

If TRUE, the default, will also update any out of date dependencies.

build_vignettes

if TRUE, will build vignettes. Normally it is build that's responsible for creating vignettes; this argument makes sure vignettes are built even if a build never happens (i.e. because local = TRUE).

keep_source

If TRUE will keep the srcrefs from an installed package. This is useful for debugging (especially inside of RStudio). It defaults to the option "keep.source.pkgs".

threads

number of concurrent threads to use for installing dependencies. It defaults to the option "Ncpus" or 1 if unset.

force_deps

whether to force installation of dependencies even if their SHA1 reference hasn't changed from the currently installed version.

metadata

Named list of metadata entries to be added to the DESCRIPTION after installation.

out_dir

Directory to store installation output in case of failure.

skip_if_log_exists

If the out_dir is defined and contains a file named package.out, no installation is attempted.

...

additional arguments passed to install.packages when installing dependencies. pkg is installed with R CMD INSTALL.

Details

By default, installation takes place using the current package directory. If you have compiled code, this means that artefacts of compilation will be created in the src/ directory. If you want to avoid this, you can use local = FALSE to first build a package bundle and then install it from a temporary directory. This is slower, but keeps the source directory pristine.

If the package is loaded, it will be reloaded after installation. This is not always completely possible, see reload for caveats.

To install a package in a non-default library, use with_libpaths.

See Also

with_debug to install packages with debugging flags set.

Other package installation: install_bioc, install_bitbucket, install_cran, install_github, install_git, install_svn, install_url, install_version, uninstall