pkgTest: An function to load and install packages.

Description Usage Arguments Value Examples

Description

This function checks if a package is installed before loading it, and pulls it from the nearest CRAN server if the package is missing.

Usage

1
pkgTest(package, silent = FALSE)

Arguments

package

Character string indicating th package to be loaded. Accepts a vector of packages to load multiple packages.

silent

Should startup messages printed by the packages be surpressed? Will not surpress warnings or errors. Defaults to FALSE.

Value

The messages printed by the loaded package, or a message if the package is not found.

Examples

1
2
3
4
5
verbose_packages <- c("gmm", "foreign", "sp")
silent_packages <- c("data.table", "compiler", "speedglm")

pkgTest(verbose_packages)
pkgTest(silent_packages)

BPJandree/AutoGLM documentation built on May 5, 2019, 10:25 a.m.