[R] R_LIBS difficulty ?
François Pinard
pinard at iro.umontreal.ca
Fri Apr 15 00:47:44 CEST 2005
[Prof Brian Ripley]
> [François Pinard]
> >Now using this line within `~/.Renviron':
> > R_LIBS=/home/pinard/etc/R
> >my tiny package is correctly found by R. However, R does not seem to
> >see any library within that directory if I rather use either of:
> > R_LIBS=$HOME/etc/R
> > R_LIBS="$HOME/etc/R"
> Correct, and as documented. See the description in ?Startup,
> which says things like ${foo-bar} are allowed but not $HOME, and
> not ${HOME}/bah or even ${HOME}. But R_LIBS=~/etc/R will work in
> .Renviron since ~ is intepreted by R in paths.
Hello, Brian (or should I rather write Prof Ripley?).
Thanks for having replied. I was not sure how to read "but not", which
could be associated either with "which says" or "are allowed". My
English knowledge is not fully solid, and I initially read you meant the
later, but it seems the former association is probably the correct one.
The fact is the documentation never says that `$HOME' or `${HOME} are
forbidden. It is rather silent on the subject, except maybe for this
sentence: "value is processed in a similar way to a Unix shell" in the
Details section, which vaguely but undoubtedly suggests that `$HOME' and
`${HOME}' might be allowed. Using `~/' is not especially documented
either, except from the Examples section, where it is used. I probably
thought it was an example of how shell-alike R processes `~/.Renviron'.
> >The last writing (I mean, something similar) is suggested somewhere in
> >the R manuals (but I do not have the manual with me right now to give
> >the exact reference, I'm in another town).
> It is not mentioned in an R manual, but it is mentioned in the FAQ.
I tried checking in the FAQ. By the way, http://www.r-project.org
presents a menu on the left, and there is a group of items under the
title `Documentation'. `FAQs' is shown under that title, but is not
clickable. I would presume it was meant to be? However, the `Other'
item is itself clickable, and offers a link to what appears to be an
FAQs page.
The only thing I saw, in item 5.2 of the FAQ (How can add-on packages be
installed?) says that one may use `$HOME/' while defining `R_LIBS' in a
Bourne shell profile, or _preferably_ use `~/` while defining `R_LIBS'
within file `~/.Renviron`. The FAQ does not really say that `$HOME' is
forbidden. The FAQ then refers to `?Startup' for more information, and
`?Startup' is not clear on this thing, in my opinion at least.
> R_LIBS=$HOME/etc/R will work in a shell (and R_LIBS=~/etc/R may not).
> >Another hint that it could be expected to work is that the same
> >`~/.Renviron' once contained the line:
> > R_BROWSER=$HOME/bin/links
> >which apparently worked as expected. (This `links' script launches
> >the real program with `-g' appended whenever `DISPLAY' is defined.)
> Yes, but that was not interpreted by R, rather a shell script called by R.
Granted, thanks for pointing this out.
The documentation does not really say either (or else I missed it) if
the value of R_BROWSER is given to exec, or given to an exec'ed shell.
If a shell is called, it means in particular that we can use options,
and this is a useful feature, worth being known I guess.
Once again, thanks for having replied, and for caring.
--
François Pinard http://pinard.progiciels-bpi.ca
More information about the R-help
mailing list