Hi Chris,
On 10 September 2008 at 15:10, Christian Hudon wrote:
| Package: r-base-core
| Version: 2.7.1-1
|
| Local R customizations by the sysadmin to the R startup are supposed to
| be done in the Rprofile.site file. However, R currently looks for that
| file under /usr (more precisely: /usr/lib/R/etc/Rprofile.site). It'd be
Yes, typically _everything_ for R is below $R_HOME. [1] This is documented
behaviour.
| nice to have the same setup as for other config files that R expects in
| /usr/lib/R/etc: a symlink to a corresponding file under /etc/R, together
| maybe with a small stock file as /etc/R/Rprofile.site containing only a
| comment explaining that this is the place to do local customizations to
| the R startup by the sysadmin using R code, making the file easier to
| find.
Not such a bad idea ... but see below:
| (The location and name of the file for local R customization is
| not documented in the R manpage. I had to run strace on a R process to
| find it.)
Well, first off, congrats for finding it :) Second, you didn't have too,
this is all documented in help(Startup) [ though I agree that finding
help is not always easy; OTOH doing help.search("Rprofile") would have
lead you there, along with some false positives ]
Third and most importantly, ?Startup says
Unless '--no-environ' was given on the command line, R searches
for site and user files to process for setting environment
variables. The name of the site file is the one pointed to by the
environment variable 'R_ENVIRON'; if this is unset or empty,
'R_HOME/etc/Renviron.site' is used (if it exists, which it does
not in a 'factory-fresh' installation). The user files searched
for are '.Renviron' in the current or in the user's home directory
(in that order). See 'Details' for how the files are read.
Then R 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 'R_PROFILE' environment
variable. If this variable is unset, the default is
'R_HOME/etc/Rprofile.site', which is used if it exists (which it
does not in a 'factory-fresh' installation). This code is sourced
into the 'base' package. Users need to be careful not to
unintentionally overwrite objects in 'base', and it is normally
advisable to use 'local' if code needs to be executed: see the
examples.
In both cases, Rprofile.site and Renviron.site are supposed to be empty!
That usually held me back from installing these.
Do you feel very strongly about having empty stubs? I'd prefer to just
leave things as they are; it's just one less thing that can break one day.
I'd appreciate further comments.
Cheers, Dirk
[1] Our use of /usr/share/R for arch-independent files stretches this further
than any other installations I am aware of.
| Thanks,
|
| Christian
|
|
|
--
Three out of two people have difficulties with fractions.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]