Skip to content

Instantly share code, notes, and snippets.

@RobertMyles
Created July 8, 2016 19:19
Show Gist options
  • Save RobertMyles/96665be044540e9ac668ee697dac6db7 to your computer and use it in GitHub Desktop.
Save RobertMyles/96665be044540e9ac668ee697dac6db7 to your computer and use it in GitHub Desktop.
Load multiple packages at the same time in R
# library() or require() only load one package at a time
# but...
Packages <- c("dplyr", "ggplot2", "rstan", "readr")
lapply(Packages, library, character.only = TRUE)
# this loads as many as you put in 'Packages'. They need to be installed first, of course.
@priyasaivasan
Copy link

priyasaivasan commented Sep 11, 2021

Thanks for the share! much convenient than pacman::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment