makeSureAllPackagesInstalled: Pre-test for packages in SpaDES modules

View source: R/packages.R

makeSureAllPackagesInstalledR Documentation

Pre-test for packages in SpaDES modules

Description

This function can be put at the start of project code. It will only be necessary if there are multiple simInit calls (i.e., the project doesn't use only one call). It will check all modules in modulePath for package dependencies. It will prompt.

Usage

makeSureAllPackagesInstalled(
  modulePath,
  doInstalls = TRUE,
  verbose = getOption("Require.verbose")
)

Arguments

modulePath

The path to modules, as per SpaDES.core::setPaths. Can be a vector of multiple character strings representing multiple locations of modules.

doInstalls

logical. If TRUE, the default, then this function will attempt to do the package installations. If FALSE, then this function returns the character vector of packages (and version information) that is unduplicated, i.e., the one with a highest minimum version specification.

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, the return object will have an attribute: attr(.., "Require") which has lots of information about the processes of the installs.

Examples

## Not run: 
makeSureAllPackagesInstalled(modulePath = "modules")

# Multiple modulePath
makeSureAllPackagesInstalled(c(
  "~/GitHub/WBI_fireSense/modules/",
  "~/GitHub/SpaDES-modules/modules/"
))

## End(Not run)

PredictiveEcology/SpaDES.install documentation built on March 10, 2023, 1:19 p.m.