Use any package. If package is not installed, this will install from CRAN.

usePkg(packageName, allowInstall = FALSE)

Arguments

packageName

Name of package as *string*.

allowInstall

let the package be installed from CRAN

Value

TRUE if package successfully loaded, FALSE otherwise.

Examples

usePkg("randomForest")
#> randomForest 4.6-14
#> Type rfNews() to see new features/changes/bug fixes.
#> [1] TRUE
usePkg("stats", allowInstall = TRUE)
#> [1] TRUE