Skip to content
Prev 1718 / 15076 Next

some errors

Thanks for all the help.

First a summary: amongst the very many help suggestion, the best 
approach seems to be to use ~/.Renviron: in that file it is possible to 
set "environment" variables which are used even if there is no 
environment, such as when start the R GUI. This means that the values 
will be used in every invocation fo R - under shell, in Carbon Emacs, in 
the GUI.

Now, I actually tried that out without success before my post. I have 
done some further research and I think I have found some kind of bug 
(or else something very strange).

First off: I have tried everything on a Linux system running R-2.0.1 
where it works as expected.

My .Renviron is as follows 
 R_LIBS=/Users/kdh/Library/R/library
 R_PAPERSIZE=letter
 R_EDITOR=/usr/bin/nano
It is being parsed begause the settings affect the papersize and the 
editor used by R. The problem is the R_LIBS, and it is quite strange. 
Now, I have removed everything from my .profile as seen by

grue:~ kdh$ echo $R_LIBS

grue:~ kdh$ R

R : Copyright 2005, The R Foundation for Statistical Computing
<SNIP: R elcome message>
[1] "/Library/Frameworks/R.framework/Resources/library"
R_LIBS 
"/Users/kdh/Library/R/library"
[1] "/Users/kdh/Library/R/library"                     
[2] "/Library/Frameworks/R.framework/Resources/library"

What is appearent from the transcript is
1) R_LIBS is actually set as seen by Sys.getenv.
2) This does not affect .libPaths()
3) However, passing R_LIBS to .libPaths() sets up everything correctly.

This baffles me quite a lot... I think it most be a mac bug since it 
works under Linux (ok, on an older version, but still...)

Just for completeness sake: I am running Tiger, with the R-2.1.0 patched 
version. I do not have administration privileges, but it seems to me 
that the permissions on ~/Library/ and subdirectories are as they ought 
to be. R is owned by root.

And finally, I realized that the typo in preferences probably should be 
corrected to $HOME/Library/R/library (although I must add that this 
setting is also not reflected in .libPaths())

Kasper
On Wed, Jun 08, 2005 at 08:56:00PM -0700, Byron Ellis wrote: