From ripley@stats.ox.ac.uk  Thu Oct 17 17:29:36 2002
From: ripley@stats.ox.ac.uk (ripley@stats.ox.ac.uk)
Date: Thu, 17 Oct 2002 17:29:36 +0100 (BST)
Subject: Documentation for .Renviron (PR#2175)
In-Reply-To: <200210161721.TAA00766@pubhealth.ku.dk>
Message-ID: <Pine.LNX.4.31.0210171717250.962-100000@gannet.stats>

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.

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

Thanks.

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

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


Documentation for .Renviron (PR#2175)
ripley@stats.ox.ac.uk