Internal function to install packages
.installPackages(
packages,
repos = getOption("repos"),
githubPkgs = character(0),
githubPkgNames,
nonLibPathPkgs = character(0),
install_githubArgs,
install.packagesArgs = list(),
libPath = .libPaths()[1],
standAlone = standAlone,
forget = FALSE
)trimVersionNumber(packages)
Character vector of packages to install via
install.packages
, then load (i.e., with library
). If it is
one package, it can be unquoted (as in require
)
The remote repository (e.g., a CRAN mirror), passed to install.packages
,
Character vector of github repositories and packages, in the
form username/package@branch
, with branch being optional.
Character vector of the package names, i.e., just the R package name.
Character vector of all installed packages that are in .libPaths
,
but not in libPath
. This would normally include a listing of
base packages, but may also include other library paths if
standAlone
if FALSE
List of optional named arguments, passed to install_github
.
List of optional named arguments, passed to install.packages
.
The library path where all packages should be installed, and looked for to load
(i.e., call library
)
Logical. If TRUE
, all packages will be installed and loaded strictly
from the libPaths
only. If FALSE
, all .libPaths
will
be used to find the correct versions. This can be create dramatically faster
installs if the user has a substantial number of the packages already in their
personal library. In the case of TRUE
, there will be a hidden file
place in the libPath
directory that lists all the packages
that were needed during the Require
call. Default FALSE
to
minimize package installing.
Internally, this function identifies package dependencies using a memoised
function for speed on reuse. But, it may be inaccurate in some cases,
if packages were installed manually by a user. Set this to TRUE
to
refresh that dependency calculation.
# NOT RUN {
.installPackages("crayon")
# }
Run the code above in your browser using DataLab