-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install tidyverse rather than individual packages
and add some comments to installation code
- Loading branch information
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |