R.utils (version 2.4.0)

use: Attaches or loads packages

Description

Attaches or loads packages. If a package is not installed, it (and its dependencies) will be installed from one of the (known) repositories.

Usage

"use"(pkg="R.utils", version=NULL, how=c("attach", "load"), quietly=TRUE, warn.conflicts=!quietly, install=TRUE, repos=getOption("use/repos", c("[[current]]", "[[mainstream]]")), ..., verbose=FALSE)

Arguments

pkg
A character vector specifying the package(s) to be used.
version
(optional) Version constraint(s) on requested package(s).
how
A character string specifying whether the package should be attached or loaded.
quietly
If TRUE, minimal or no messages are reported.
warn.conflicts
If TRUE, warnings on namespace conflicts are reported, otherwise not.
install
If TRUE and the package is not installed or an too old version is installed, then tries to install a newer version, otherwise not.
repos
(optional) A character vector specifying from which repositories to install the package from, iff a requested package is not already installed.
...
Additional named arguments passed to require() or requireNamespace().
verbose
If TRUE, verbose output is generated (regardless of quietly).

Value

Returns a vector of package_version() for each package attached/loaded. If one of the requested packages/package versions is not available and could not be installed, an error is thrown.

See Also

library() and "base::install.packages". To modify the set of known repositories, set option repos (see options()), which can also be done via setRepositories.