mu.library: Load and Install Required R Packages

View source: R/mu.library.r

mu.libraryR Documentation

Load and Install Required R Packages

Description

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.

Usage

mu.library(wants)

Arguments

wants

A character vector containing the names of R packages to load

Details

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.

Value

Invisibly returns the results of loading each package via lapply

Examples

# Load a single package
mu.library("dplyr")

# Load multiple packages
mu.library(c("ggplot2", "tidyr", "readr"))


ccamp83/mu documentation built on Nov. 7, 2024, 5:17 p.m.