Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install basic set of R packages
.libPaths() #By default, R will install packages to the first element
#This script will install some very common R packages.
repos = '' #Main CRAN = '' #Site provides some prebuilt binaries for Windows
repos.rforge = ''
libraries = c('Deducer', 'devtools', 'doBy', 'foreign', 'gdata', 'ggplot2', 'gmaps',
'Hmisc', 'JGR', 'maps', 'mapdata', 'mapproj', 'maptools', 'proto', 'psych', 'R2wd',
'Rcmdr', 'RCurl', 'reshape', 'RODBC', 'roxygen2', 'seqinr', 'sm', 'sp',
'sqldf', 'survey', 'WriteXLS', 'XML', 'xtable')
if(['sysname'] == 'Windows') {
oDrive = 'o:/'
memory.limit(size=4095) #Set to 4GB (for 64-bit Windows, this can be much larger)
install.packages(libraries, repos=c(repos,, type='win.binary', dep=TRUE)
install.packages('qualtrics', repos=c(repos.rforge, repos,
} else if(['sysname'] == 'Darwin') {
oDrive = NULL
install.packages(libraries, repos=c(repos), type='mac.binary.leopard', dep=TRUE)
install.packages('qualtrics', repos=c(repos.rforge, repos))
} else if(['sysname'] == 'Linux') {
oDrive = '/n01/OutcomesAssessment/'
install.packages(libraries, repos=c(repos), type='source', dep=TRUE)
install.packages('qualtrics', repos=c(repos.rforge, repos))
} else {
stop('Unsupported operating system!')
install_github('irutils', 'jbryer')
install_github('ruca', 'jbryer')
install_github('ipeds', 'jbryer')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment