Skip to content

some errors

8 messages · stefano iacus, Seth Falcon, Byron Ellis +2 more

#
Hi

I have recently (some days ago) started working on a Mac, and have a few 
"problems" to report:

So far I have been running R.app under Tiger as well as using R from 
within Emacs

1) In the "Preferences/Startup" menu, there is a spelling mistake: the 
option "Add $HOME/R/Library" should be "Add $HOME/Library/R" (I guess).

2) I tried installing Bioconductor binaries using the package menu. I 
can easily install binaries from CRAN. When I pick "bioconductor 
(binaries)" I can retrieve a list of packages from the mirror I am 
using, but when I click on an individal package and choose "Install 
selected", nothing happens. The console output is below. It seems to 
simply retieve the package list and nothing else. The fact that this 
happens only when I do Bioconductor and not CRAN seems to indicate that 
it is a Mac issue? I have installed the packages through other means, 
this is simply a user-report.

3) Could it be that R does not read environment variables when started 
on the terminal. On the terminal as well as using ESS (Emacs) I can not 
get .libPaths() to include /Users/kdh/Library/R despite the fact that I 
have exported it from ~/.profile and the variable is set (output below). 
I have also tried using ~/.Renviron

How do people solve the last issue: that of adding the user-dependent 
library, when using ESS/terminal.

The questions might be a bit basic, but still...

Kasper
***** Bioconductor install


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.

  Natural language support but running in an English locale

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.

trying URL 'http://www.bioconductor.org/bin/macosx/2.1/PACKAGES'
Content type 'text/plain; charset=ISO-8859-1' length 11224 bytes
opened URL
==================================================
downloaded 10Kb

trying URL 'http://www.bioconductor.org/bin/macosx/2.1/PACKAGES'
Content type 'text/plain; charset=ISO-8859-1' length 11224 bytes
opened URL
==================================================
downloaded 10Kb


******* R_LIBS probelm

north-mesh-wlan-87:~ kdh$ echo $R_LIBS
/Users/kdh/Library/R/
north-mesh-wlan-87:~ kdh$ 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.
[1] "/Library/Frameworks/R.framework/Resources/library"
#
On 08/giu/05, at 17:38, Kasper Daniel Hansen wrote:

            
right,
it's a bug. Use "Specify location" with http://www.bioconductor.org   
as URL, and specify the "binary format".
Then it should work.
#
Hi Kasper,
On Jun 8, 2005, at 8:38 PM, Kasper Daniel Hansen wrote:

            
Thanks.
Stefano answered this one ... I hope to fix it in one of the next  
nightly builds ...
Reading ~/.profile is the task of the shell, not R, and AFAIR by  
definition it's used for login shells only. ~/.Renviron works for me  
(tested with ESS 5.2.8) - make sure the directory you specify in  
R_LIBS exists, otherwise it will be silently discarded by R.

Cheers,
Simon
#
Hi Kasper,
On 8 Jun 2005, k.hansen@biostat.ku.dk wrote:
I suspect the issue here is that Emacs isn't picking up your
environment.  GUI apps started from the Finder don't get the same
environment (.profile, .bash_profile, etc.) that apps started from the
Terminal do.

My solution: I start my Emacs from Terminal and then it inherits the
proper PATH and other env vars such as R_LIBS.

There is another possible solution that involves editing
~/.MacOSX/environment.plist, but I never managed to get that working
as I wanted.

Best,

+ seth
#
Or you can just

(setenv "R_LIBS" (format "%s/Library/R/library" (getenv "HOME")))

in your .emacs. You can also set your DISPLAY variable there as well.  
I'm sure if you were VERY enterprising you could write some elisp  
that would snarf your .profile, parse it and then run the elisp  
equivalents.
On Jun 8, 2005, at 8:48 PM, Seth Falcon wrote:

            
---
Byron Ellis (ellis@stat.harvard.edu)
"Oook" -- The Librarian
#
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:

  
    
#
Kasper,
On Jun 9, 2005, at 1:08 AM, Kasper Daniel Hansen wrote:

            
Yes.
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.
Can you, please, check the ls -ld $R_LIBS output?
BTW: That works only for LS-started applications.

Cheers,
Simon
#
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: