Sunday, October 28, 2012

customizing R


On windows:
C:\Program Files\R\R-2.15.1\etc\Rprofile.site


My Rprofile with added custom color schemes

# Things you might want to change

# options(papersize="a4")
# options(editor="notepad")
# options(pager="internal")

# set the default help type
# options(help_type="text")
  options(help_type="html")

# set a site library
# .Library.site <- file.path(chartr("\\", "/", R.home()), "site-library")

# set a CRAN mirror
# local({r <- getOption("repos")
#       r["CRAN"] <- "http://my.local.cran"
#       options(repos=r)})

# Give a fortune cookie, but only to interactive sessions
# (This would need the fortunes package to be installed.)
if (interactive()) {
   fortunes::fortune()
   
   #---- custom color schemes
   library(grDevices)
   blue.colors = colorRampPalette(RColorBrewer::brewer.pal(9,"Blues"))
   jet.colors = colorRampPalette(c("blue","#007FFF","cyan","#7FFF7F","yellow","#FF7F00","red"))
   blackBody.colors = colorRampPalette(c("black", "red", "orange","yellow","lightyellow"),space="rgb")
}


No comments:

Post a Comment

Checking font availability on Mac   fc-list : family | grep "Fira Code"   or   system_profiler -json SPFontsDataType | grep \...