Skip to content

Documentation for .Renviron (PR#2175)

4 messages · j.c.rougier@durham.ac.uk, Brian Ripley, Jonathan Rougier

#
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.

2) In the details, there is a missing "way" in "`value' is processed
in a similar to a Unix shell."

Cheers, Jonathan.

--please do not edit the information below--

Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status = 
 major = 1
 minor = 6.0
 year = 2002
 month = 10
 day = 01
 language = R

Search Path:
 .GlobalEnv, Autoloads, package:base

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 16 Oct 2002 j.c.rougier@durham.ac.uk wrote:

            
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.
Thanks.

  
    
#
ripley@stats.ox.ac.uk wrote:
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.
#
On Fri, 18 Oct 2002, Jonathan Rougier wrote:

            
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.