glibrary: Try to load a library, if that fails, install it, then load...

Description Usage Arguments Value Note Examples

Description

glibrary short for (get)library. The primary aim of this function is to make loading packages more transparent. Given that we know we want to load a given package, actually fetching it is a formality. glibrary skims past this formality to install the requested package.

Usage

1
2
glibrary(..., lib.loc = NULL, quietly = FALSE, warn.conflicts = TRUE,
  pickmirror = FALSE, countrycode = "us")

Arguments

...

comma seperated package names

lib.loc

See require

quietly

See require

warn.conflicts

See require

pickmirror

If TRUE, glibrary allows the user to select the mirror, otherwise it auto-selects on the basis of the country code

countrycode

This option is ignored and the first mirror with the substring "Cloud", e.g. the RStudio cloud, is selected. If no mirrors with that substring are identified, glibrary compares this value to results from getCRANmirrors() to select a mirror in the specified country.

Value

logical; TRUE if glibrary was a success, an error if a package failed to load

Note

keep.source was an arguement to require that was deprecated in R 2.15

This warning Warning in install.packages: InternetOpenUrl failed: 'The operation timed out' indicates that the randomly selected repository is not available. Check your internet connection. If your internet connection is fine, set pickmirror=TRUE and manually select an operational mirror.

Examples

1
#glibrary(lattice,MASS) #not run to prevent needless dependency

drknexus/repsych documentation built on May 15, 2019, 2:19 p.m.