requirePackages {BBmisc}R Documentation

Require some packages.

Description

If some packages could not be loaded and stop is TRUE the following exception is thrown: “For <why> please install the following packages: <missing packages>”. If why is NULL the message is: “Please install the following packages: <missing packages>”.

Usage

requirePackages(packs, why = NULL, stop = TRUE, suppress.warnings = FALSE,
  ...)

Arguments

packs

[character]
Names of packages.

why

[character(1)]
Short string explaining why packages are required. Default is NULL.

stop

[logical(1)]
Should an exception be thrown for missing packages? Default is TRUE.

suppress.warnings

[logical(1)]
Should warnings be suppressed in the calls to require? Default is FALSE.

...

[any]
Passed on to require.

Value

[logical]. Named logical vector describing which packages could be loaded. Same length as packs.

Examples

requirePackages(c("BBmisc", "base"), why="BBmisc example")
## BBmisc   base 
##   TRUE   TRUE

[Package BBmisc version 1.7 Index]