Skip to content

Instantly share code, notes, and snippets.

@stefanooldeman
Created November 25, 2014 14:38
Show Gist options
  • Save stefanooldeman/088f2181008fc766b98c to your computer and use it in GitHub Desktop.
Save stefanooldeman/088f2181008fc766b98c to your computer and use it in GitHub Desktop.
Install a list of packages
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