mu.library | R Documentation |
This function checks if requested packages are installed, installs missing ones, and loads all requested packages into the R environment. It simplifies package management by handling both installation and loading in a single function call.
mu.library(wants)
wants |
A character vector containing the names of R packages to load |
The function performs three main steps: 1. Checks which requested packages are already installed 2. Installs any missing packages from CRAN 3. Loads all requested packages using require()
Packages are installed with dependencies from the cloud.r-project.org repository.
Invisibly returns the results of loading each package via lapply
# Load a single package
mu.library("dplyr")
# Load multiple packages
mu.library(c("ggplot2", "tidyr", "readr"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.