Skip to content

Instantly share code, notes, and snippets.

@mccurcio
Last active September 4, 2020 19:55
Show Gist options
  • Save mccurcio/3feb9e4bf722bb7930aab580284d122d to your computer and use it in GitHub Desktop.
Save mccurcio/3feb9e4bf722bb7930aab580284d122d to your computer and use it in GitHub Desktop.
install or load libraries in R
## install or load libraries in R
Libraries <- c("knitr", "ggfortify")
for (p in Libraries) {
#if (!require(p, character.only = TRUE) { install.packages(p) }
library(p, character.only = TRUE)
}
Libraries <- c('knitr', 'ggfortify')
for (p in Libraries) {
library(p, character.only = TRUE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment