Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Mon Jun 22 14:49:22 CEST 1998

Jim Lindsey <jlindsey at luc.ac.be> writes:

> > This is from the R-FAQ:
> > 
> >      In R, the startup mechanism is as follows.  R first searches for the
> >      site-wide startup profile unless the command line option
> >      `--no-site-file' was given.  The name of this file is taken from the
> >      value of the `RPROFILE' environment variable.  If that variable is
> >      unset, the default is ``$RHOME'/etc/Rprofile'.  Then, unless
> >      `--no-init-file' was given, R searches for a file called `.Rprofile'
> >      in the current directory or in the user's home directory (in that
> >      order) and sources it.  It also loads a saved image from `.RData' in
> >      case there is one (unless `--no-restore' was specified).  If needed,
> >      the functions `.First()' and `.Last()' should be defined in the
> >      appropriate startup profiles.
> > 
> > I.e., if you want a ``global Rprofile'', then use the RPROFILE variable:
> This is not the way my version of R62 is functioning. I am using the
> default installation except that I slightly modified Rprofile in the
> library/base/R directory as my site file (as I do with each new
> version). It is definitely reading this file (as it did in R61) and
> not the etc/Rprofile mentioned in the faq (I have not checked if the
> latter even exists). When I reinstall the base library, my
> modifications are overwritten.

Yup. The FAQ is imprecise there. The exact logic is

        R_LoadProfile(R_OpenSysInitFile()); /*always!*/
        R_LoadProfile(R_OpenSiteFile()); /*if existing*/
        R_LoadProfile(R_OpenInitFile()); /*if existing*/

Note that if all three are executed if they exist. However, at least
the system init file doesn't do anything that can't be undone later

The first reads $RHOME/library/base/R/Rprofile which you are not
supposed to tamper with (or else *we* wouldn't be able to tamper with

Thes second looks in $RPROFILE, and if it isn't there, in

The third looks in ./.Rprofile and $HOME/.Rprofile in that order.

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list