Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dsparks/3497745 to your computer and use it in GitHub Desktop.
Save dsparks/3497745 to your computer and use it in GitHub Desktop.
Install and load a vector of package names
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)
@dsparks
Copy link
Author

dsparks commented Oct 2, 2012

Note: The last "}" on the install.packages() line is at the 79th character.

@dsparks
Copy link
Author

dsparks commented Oct 2, 2012

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