Skip to content

Install and uninstall R packages in batch from string of library() calls

License

Notifications You must be signed in to change notification settings

yulexun/batchpkginstall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Batch Package Install

This R package simplifies the process of managing multiple R packages with functions to extract, install, load, and uninstall packages in bulk based on library() calls.

Features

  • Batch Installation: Install multiple missing packages and provide user prompts for confirmation.
  • Batch Loading: Load all specified packages with error handling.
  • Batch Uninstallation: Uninstall multiple packages with user confirmation.

Installation

library(devtools)
install_github("yulexun/bulkpkginstall")

Functions

binstall(librarylines)

Installs and loads R packages from a string containing library() calls.

Arguments

  • librarylines: A string of R code with library() calls.

Functionality

  1. Checks for missing packages.
  2. Prompts the user to install missing packages.
  3. Optionally loads all packages.

buninstall(librarylines)

Uninstalls packages based on a string of library() calls.

Arguments

  • librarylines: A string of R code with library() calls.

Functionality

  1. Identifies installed packages.
  2. Prompts the user to confirm uninstallation.
  3. Uninstalls specified packages.

Usage Example

# Example library() calls as a string
library_lines <- "
library(ggplot2)
library(dplyr)
library(tidyverse)
"

# Install and load packages
binstall(library_lines)

# Uninstall packages
buninstall(library_lines)

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

About

Install and uninstall R packages in batch from string of library() calls

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages