Created
November 25, 2014 14:38
-
-
Save stefanooldeman/088f2181008fc766b98c to your computer and use it in GitHub Desktop.
Install a list of packages
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
common_packages <- c('batch','data.table','plyr','sqldf') | |
## adjust as necessary, see help('download.packages') | |
repos <- "http://cran.rstudio.com" | |
## this makes sense on Debian where no packages touch /usr/local | |
lib.loc <- "/usr/local/lib/R/site-library/" | |
## install packages | |
sapply(common_packages, function (pkg) install.packages(pkg, lib.loc, repos)) | |
## clean up any temp file | |
sapply(strsplit(list.files(path='/tmp', pattern="^Rtmp.*$", full.names=TRUE), " "), function (f) unlink(f, force=TRUE)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment