Learn R Programming

petersenlab (version 1.1.0)

load_or_install: Load or Install Packages.

Description

Loads packages or, if not already installed, installs and loads packages.

Usage

load_or_install(package_names, ...)

Value

Loaded packages.

Arguments

package_names

Character vector of one or more package names.

...

Additional arguments for install.packages().

Details

Loads packages that are already installed, and if the packages are not already installed, it installs and then loads them.

See Also

Examples

Run this code
if (FALSE) {
old <- options("repos")
options(repos = "https://cran.r-project.org")
# Warning: the command below installs packages that are not already installed
load_or_install(c("tidyverse","nlme"))
options(old)
}

Run the code above in your browser using DataLab