Learn R Programming

Xmisc (version 0.2.1)

check.packages: Check if a package can be loaded

Description

Check if a package can be loaded. If TRUE, load it as long as it has not yet been loaded.

Usage

check.packages(x, envir = sys.frame(sys.parent(0)), character.only = FALSE)

Arguments

x
package, see library or require.
envir
the environment to use.
character.only
see library or require.

Value

logical, whether a package can be loaded.

See Also

is.package.loaded

Examples

Run this code
check.packages("Xmisc")
check.packages(Xmisc)
x <- "Xmisc"
check.packages(x,character.only=TRUE)

Run the code above in your browser using DataLab