SpaDES (version 1.2.0)

loadPackages: Load packages.

Description

Load and optionally install additional packages.

Usage

loadPackages(packageList, install = FALSE, quiet = TRUE)
"loadPackages"(packageList, install = FALSE, quiet = TRUE)
"loadPackages"(packageList, install = FALSE, quiet = TRUE)
"loadPackages"(packageList, install = FALSE, quiet = TRUE)

Arguments

packageList
A list of character strings specifying the names of packages to be loaded.
install
Logical flag. If required packages are not already installed, should they be installed?
quiet
Logical flag. Should the final "packages loaded" message be suppressed?

Value

Specified packages are loaded and attached using require(), invisibly returning a logical vector of successes.

See Also

require.

Examples

Run this code
## Not run: 
#   pkgs <- list("ggplot2", "lme4")
#   loadPackages(pkgs) # loads packages if installed
#   loadPackages(pkgs, install = TRUE) # loads packages after installation (if needed)
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace