Hi, R people. I'm shy reporting this, as a bug in this area sounds very unlikely. Did I make my tests wrongly? I'm still flaky at all this. Let me dare nevertheless, who knows, just in case... Please don't kill me! :-) Not so long ago, I wrote to this list:> (For now, [the library code] works only for me when I do _not_ use `-l > MY/OWN/LIBDIR' at `R CMD INSTALL' time, I surely made a simple blunder > somewhere. Hopefully, I'll figure it out.)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" 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). 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.) This is R 2.0.1, installed on SuSE 9.2. -- Fran?ois Pinard http://pinard.progiciels-bpi.ca
Fran?ois Pinard <pinard at iro.umontreal.ca> writes:> Hi, R people. > > I'm shy reporting this, as a bug in this area sounds very unlikely. Did > I make my tests wrongly? I'm still flaky at all this. Let me dare > nevertheless, who knows, just in case... Please don't kill me! :-) > > Not so long ago, I wrote to this list: > > > (For now, [the library code] works only for me when I do _not_ use `-l > > MY/OWN/LIBDIR' at `R CMD INSTALL' time, I surely made a simple blunder > > somewhere. Hopefully, I'll figure it out.) > > 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" > > 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).?Startup gets you there soon enough (and help.search(Renviron) points you at Startup): Lines in a site or user environment file should be either comment lines starting with '#', or lines of the form 'name=value'. The latter sets the environmental variable 'name' to 'value', overriding an existing value. If 'value' is of the form '${foo-bar}', the value is that of the environmental variable 'foo' if that exists and is set to a non-empty value, otherwise 'bar'. This construction can be nested, so 'bar' can be of the same form (as in '${foo-${bar-blah}}'). so R_LIBS=${HOME}/etc/R is what should work. Notice that this is processed by R internally, not by the shell, so syntax may differ from the command-line equivalent. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
On Sun, 10 Apr 2005, Fran?ois Pinard wrote:> Hi, R people. > > I'm shy reporting this, as a bug in this area sounds very unlikely. Did > I make my tests wrongly? I'm still flaky at all this. Let me dare > nevertheless, who knows, just in case... Please don't kill me! :-) > > Not so long ago, I wrote to this list: > >> (For now, [the library code] works only for me when I do _not_ use `-l >> MY/OWN/LIBDIR' at `R CMD INSTALL' time, I surely made a simple blunder >> somewhere. Hopefully, I'll figure it out.) > > 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.> 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. 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. -- Brian D. Ripley, ripley at 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Maybe Matching Threads
- R CMD check not reading R_LIBS from ~/.R/check.Renviron
- Debian Testing: ~/.Renviron seems to not being read (R_LIBS not set)
- setting R_LIBS
- Customization options with .Renviron, R_LIBS, .Rprofile etc
- Trouble with R CMD check: I can't seem to get dependencies right (maybe I'm using R_LIBS incorrectly?)