SpaDES (version 1.1.4)

loadPackages: Load packages.

Description

Load and optionally install additional packages.

Usage

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

## S3 method for class 'character': loadPackages(packageList, install = FALSE, quiet = TRUE)

## S3 method for class 'list': loadPackages(packageList, install = FALSE, quiet = TRUE)

## S3 method for class '`NULL`': 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
pkgs <- list("ggplot2", "lme4")
  loadPackages(pkgs) # loads packages if installed
  loadPackages(pkgs, install = TRUE) # loads packages after installation (if needed)

Run the code above in your browser using DataLab