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
3
  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

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

russmisc documentation built on May 2, 2019, 4:44 p.m.