Skip to content

Instantly share code, notes, and snippets.



Created Mar 7, 2012
What would you like to do?
My .Rprofile that works both on Windows and Linux
# .Rprofile -- commands in this file will be executed at the beginning of
# each R session. On Windows, the R_PROFILE environment variable must have value
# with the full path to this file. On Linux (or other Unix like systems) this file
# must be in the user's home directory.
# Set the default repository to the main CRAN site
# Set the oDrive varaible and library path
if(['sysname'] == 'Windows') {
oDrive = 'o:/'
.libPaths(paste(oDrive, 'R/library/Windows', sep=''))
require(utils, quietly=TRUE)
print("Setting memory limit for R to 4GB...")
memory.limit(size=4095) #Set to 4GB (for 64-bit Windows, this can be much larger)
message(paste('R_LIBS: ', Sys.getenv('R_LIBS'), sep=''))
message(paste('R_PROFILE: ', Sys.getenv('R_PROFILE'), sep=''))
} else if(['sysname'] == 'Linux') {
oDrive = '/n01/OutcomesAssessment/'
.libPaths(paste(oDrive, 'R/library/Linux', sep=''))
} else if(['sysname'] == 'Darwin') {
oDrive = NULL
# Customize the default look and feel of ggplot2
if(require(ggplot2, quietly=TRUE)) {
# On Linux we will alter the default behavior of the makeR package.
if(['sysname'] == 'Linux') {
if(require(makeR, quietly=TRUE)) {
# Change the location of the SQL repository
if(require(irutils, quietly=TRUE)) {
setSQLRepos(paste(oDrive, 'R/ecir/data', sep=''))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.