Next: Memory management in S
Up: Getting started
Previous: Data objects, memory, and
- The file $HOME/.Renviron can be used to set environment
variables within R. The current value of environment variables can
be seen using >options(). For example, my .Renviron
/R/library # use so it knows to look in
this directory for libraries
- The file $HOME/.Rprofile is sourced when R starts. This
is a handy place to call libraries that you use often and define functions.
For example, my .Rprofile file contains:
library(ts) # for acf
library(mgcv) # for GAMs
- You can also create .First files in .Rprofile that
are called on startup. Or .First files can live in .RData.
- Finally, note that you can have local .Renviron and .Rprofile
files that are called only when starting R in the particular directory.
Initialization code for Splus in Linux is in $HOME/MySwork/.S.init.
Any S code in this file is run at the beginning of your S session,
regardless of which .Data directory you are using.