Documentation for .Renviron (PR#2175)

ripley@stats.ox.ac.uk ripley@stats.ox.ac.uk
Fri, 18 Oct 2002 08:49:49 +0100 (BST)


On Fri, 18 Oct 2002, Jonathan Rougier wrote:

> ripley@stats.ox.ac.uk wrote:
> >
> > On Wed, 16 Oct 2002 j.c.rougier@durham.ac.uk wrote:
> >
> > > Hi everyone,
> > >
> > > Two minor points about ?.Renviron.
> > >
> > > 1) If R_ENVIRON is not set then R defaults to `${R_HOME}/etc/Renviron',
> > > not `${R_HOME}/etc/Renviron.site' as stated.
> >
> > No, it does as it states. See the code fragment
> >
> > /* try site Renviron: R_ENVIRON, then R_HOME/etc/Renviron.site. */
> > void process_site_Renviron ()
> > {
> >     char buf[PATH_MAX];
> >
> >     if(process_Renviron(getenv("R_ENVIRON"))) return;
> >     if(strlen(R_Home) + strlen("/etc/Renviron.site") > PATH_MAX - 1) {
> >         R_ShowMessage("path to Renviron.site is too long: skipping");
> >         return;
> >     }
> >     sprintf(buf, "%s/etc/Renviron.site", R_Home);
> >     process_Renviron(buf);
> > }
> >
> > in unix/sys-common.c.
> >
> > The description is inaccurate though: R_HOME/etc/Renviron.site is read
> > unless R_ENVIRON is set to a valid file.  I've altered the code so that
> > even if R_ENVIRON is invalid R_HOME/etc/Renviron.site is skipped.
> >
> > ${R_HOME}/etc/Renviron is for R's own use. It gets read whether or not
> > R_ENVIRON is set.
>
> Perhaps that could be documented as well.  I drew my inference from
> observing that if I did not have a "Renviron.site", then modifications
> to "Renviron", which has the same syntax as "Renviron.site", showed up
> in R.

It is already documented in R-patched, with the comment that this is only
so for Unix-alikes.

Where did you get the idea that it was safe for you to tinker with
etc/Renviron, though?  Because etc/Renviron is used elsewhere (in the
shell scripts), it is not safe to change.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._