Documentation for .Renviron (PR#2175)
Jonathan Rougier
J.C.Rougier@durham.ac.uk
Fri, 18 Oct 2002 08:44:16 +0100
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.
Jonathan.
--
Jonathan Rougier Science Laboratories
Department of Mathematical Sciences South Road
University of Durham Durham DH1 3LE
tel: +44 (0)191 374 2361, fax: +44 (0)191 374 7388
http://www.maths.dur.ac.uk/stats/people/jcr/jcr.html
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._