Learn R Programming

berryFunctions (version 1.22.5)

library2: install.package and library

Description

install and load a package. If a package is not available, it is installed before being loaded

Usage

library2(name, quietly = FALSE, libargs = NULL, ...)

Value

messages help instruction.

Arguments

name

Name of the package(s). Can be quoted, must not.

quietly

passed to library. DEFAULT: FALSE

libargs

List of arguments passed to library like lib.loc, verbose etc. DEFAULT: NULL

...

Arguments passed to install.packages like lib, repos etc.

Author

Berry Boessenkool, berry-b@gmx.de, 2014+2020

See Also

Examples

Run this code

if (FALSE) {
## Excluded fom CRAN checks. Package installation on server is unnecessary.
require2(ada)
library2("statmod")
}

Run the code above in your browser using DataLab