Skip to content

Commit

Permalink
install tidyverse rather than individual packages
Browse files Browse the repository at this point in the history
and add some comments to installation code
  • Loading branch information
dmil authored Jan 20, 2023
1 parent d9668e7 commit 9b352f3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion setup.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env RScript

# A function that installs packages
installPackage <- function(pkg) {
install.packages(pkg, repos='http://cran.us.r-project.org', verbose = TRUE)
}

libs <- c("ggplot2", "readr", "extrafont", "Cairo", "devtools", "dplyr", "gridExtra", "reshape2")
# A list of packages to install, including tidyverse
# (this includes ggplot2, dplyr, and several others...)
# https://www.tidyverse.org/packages/
libs <- c("tidyverse", "extrafont", "Cairo", "devtools","gridExtra")

# Apply the function above to the list of packages
lapply(libs, installPackage)

# Print successful completion message
sprintf("Successfully loaded: %s", libs)

0 comments on commit 9b352f3

Please sign in to comment.