- packages
Either a character vector of packages to install via
install.packages
, then load (i.e., with library
), or, for convenience,
a vector or list (using c
or list
) of unquoted package names to install
and/or load (as in require
, but vectorized). Passing vectors of names may
not work in all cases, so user should confirm before relying on this behaviour
in operational code.
In the case of a GitHub package, it
will be assumed that the name of the repository is the name of the package.
If this is not the case, then pass a named character vector here, where the
names are the package names that could be different than the GitHub
repository name.
- packageVersionFile
Character string of a file name or logical. If
TRUE
, then this function will load the default file,
getOption("Require.packageVersionFile")
. If this argument is provided,
then this will override any packages passed to packages
. By default,
Require
will attempt to resolve dependency violations (i.e., if this
packageVersionFile
specifies a version of a package that violates
the dependency specification of another package). If a user wishes to attempt
to install the packageVersionFile
without assessing the dependencies,
set dependencies = FALSE
.
- libPaths
The library path (or libraries) where all packages should be
installed, and looked for to load (i.e., call library
). This can be used
to create isolated, stand alone package installations, if used with
standAlone = TRUE
. Currently, the path supplied here will be prepended to
.libPaths()
(temporarily during this call) to Require
if
standAlone = FALSE
or will set (temporarily) .libPaths()
to
c(libPaths, tail(libPaths(), 1)
to keep base packages.
- install_githubArgs
Deprecated. Values passed here are merged with
install.packagesArgs
, with the install.packagesArgs
taking precedence
if conflicting.
- install.packagesArgs
List of optional named arguments, passed to
install.packages
. Default is only --no-multi-arch
, meaning that only
the current architecture will be built and installed (e.g., 64 bit, not 32 bit,
in many cases).
- standAlone
Logical. If TRUE
, all packages will be installed to and
loaded from the libPaths
only. NOTE: If TRUE
, THIS WILL CHANGE THE
USER'S .libPaths()
, similar to e.g., the checkpoint
package. If
FALSE
, then libPath
will be prepended to .libPaths()
during the
Require
call, resulting in shared packages, i.e., it will include the
user's default package folder(s). This can be create dramatically faster
installs if the user has a substantial number of the packages already in
their personal library. Default FALSE
to minimize package installing.
- install
Logical or "force". If FALSE
, this will not try to install
anything. If "force"
, then it will force installation of requested
packages, mimicking a call to e.g., install.packages
. If TRUE
, the
default, then this function will try to install any missing packages or
dependencies.
- require
Logical or character string. If TRUE
, the default, then the
function will attempt to call require
on all requested packages
,
possibly after they are installed. If a character string, then it will only
call require
on those specific packages (i.e., it will install the ones
listed in packages
, but load the packages listed in require
)
- repos
The remote repository (e.g., a CRAN mirror), passed to either
install.packages
, install_github
or installVersions
.
- purge
Logical. Should all caches be purged? Default is
getOption("Require.purge", FALSE)
. There is a lot of internal caching of
results throughout the Require
package. These help with speed and reduce
calls to internet sources. However, sometimes these caches must be purged.
The cached values are renewed when found to be too old, with the age limit.
This maximum age can be set in seconds with the environment variable
R_AVAILABLE_PACKAGES_CACHE_CONTROL_MAX_AGE
, or if unset, defaults to 3600
(one hour -- see utils::available.packages
).
Internally, there are calls to available.packages
.
- verbose
Numeric or logical indicating how verbose should the function
be. If -1 or -2, then as little verbosity as possible. If 0 or FALSE,
then minimal outputs; if 1
or TRUE, more outputs; 2
even more. NOTE: in
Require
function, when verbose >= 2
, also returns details as if
returnDetails = TRUE
(for backwards compatibility).
- type
See utils::install.packages
- upgrade
When FALSE
, the default, will only upgrade a package when the
version on in the local library is not adequate for the version requirements
of the packages
. Note: for convenience, update
can be used for this argument.
- returnDetails
Logical. If TRUE
the return object will have an
attribute: attr(.., "Require")
which has lots of information about the
processes of the installs.
- ...
Passed to install.packages
. Good candidates are e.g., type
or
dependencies
. This can be used with install_githubArgs
or
install.packageArgs
which give individual options for those 2 internal
function calls.