some errors
Solved! (This is very embarasing, I had a .Rprofile in my test directory... - Thanks for pointing me to $R_HOME/library/base/R/Rprofile, allowing me to debug my problem) Ok, solution: The by far preferred way to set the startup libraries is by creating a .Renviron file in ~. The file looks like R_LIBS=/Users/kdh/Library/R/library (replace kdh with username). Other environment variables may be placed in the file as well, I have R_PAPERSIZE and R_EDITOR. Relevant help page: ?Startup Question: (and I know this is not Mac-specific): where do I find a list of environment variables which R respects? Specifically, it is possible to make R _not_ save the workspace upon exit by setting something in either .Renviron or .Rprofile. I know it can be done by a re-compilation. Thanks for all the help Kasper
On Thu, Jun 09, 2005 at 12:56:06PM -0400, Simon Urbanek wrote:
Kasper, On Jun 9, 2005, at 1:08 AM, Kasper Daniel Hansen wrote:
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.
Yes.
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).
I still cannot reproduce it - it works perfectly for me: gammu:urbanek$ uname -srp Darwin 8.1.0 powerpc gammu:urbanek$ ls -ld /tmp/bar drwxr-xr-x 2 urbanek wheel 68 Jun 9 12:38 /tmp/bar gammu:urbanek$ cat ~/.Renviron R_LIBS=/tmp/bar gammu:urbanek$ echo =$R_LIBS= == gammu:urbanek$ R R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.0 Patched (2005-05-12), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R.
.libPaths()
[1] "/tmp/bar" [2] "/Library/Frameworks/R.framework/Resources/library"
Sys.getenv("R_LIBS")
R_LIBS "/tmp/bar"
If you want to try to debug your problem, you may want to look at $R_HOME/library/base/R/Rprofile, because that is where .libPaths gets set.
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.
Can you, please, check the ls -ld $R_LIBS output?
There is another possible solution that involves editing ~/.MacOSX/environment.plist, but I never managed to get that working
BTW: That works only for LS-started applications. Cheers, Simon
Kasper Daniel Hansen, Research Assistant Department of Biostatistics, University of Copenhagen