loadOrInstall: Load packages or install and load packages

Description Usage Arguments Details Value Author(s) See Also

View source: R/loadOrInstall.R

Description

This functino loads packages if they are installed already. If failed, it tries to install the package automatically and re-load the package after installation.

Usage

1
loadOrInstall(package, dependencies="Depends",...)

Arguments

package

A character vector of the names of packages to be loaded.

dependencies

The same as in install.packages.

...

Additional arguments passed to require, install.packages.

Details

The function calls require to see if the package can be loaded. If not, it calls install.packages. Then require is called again for the installed package.

Value

A logical scalar. TRUE if all packages are loaded sucessfully. If FALSE, its "failed" attribute contains a vector of package names that failed to be loaded.

Author(s)

Long Qu

See Also

library, require, install.packages


pi0 documentation built on May 2, 2019, 4:47 p.m.