Created
August 28, 2012 12:49
-
-
Save dsparks/3497745 to your computer and use it in GitHub Desktop.
Install and load a vector of package names
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
doInstall <- TRUE # Change to FALSE if you don't want packages installed. | |
toInstall <- c("foreign", "ggplot2", "reshape2", "plyr", "devtools") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) |
Note: the last "}" on the install.packages() line is at the 79th character.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: The last "}" on the install.packages() line is at the 79th character.