Learn R Programming

easyr (version 0.3-1)

usepkg: Use Package

Description

Installs a package if it needs to be installed, and calls require to load the package. Author: Scott Sobel. Tech Review: Bryce Chamberlain.

Usage

usepkg(packages, noCache = FALSE, repos = utils::getCRANmirrors()$URL[1])

Arguments

packages

Character or character vector with names of the packages you want to use.

noCache

When checking packages, you can choose to ignore the cached list, which will increase accuracy but decrease speed.

repos

URL to use if a package needs to be downloaded.

Examples

Run this code
# NOT RUN {
usepkg(c('dplyr','lubridate'))
usepkg('lubridate')
# }

Run the code above in your browser using DataLab