Skip to content

Upgrading R means I lose my packages

5 messages · William Revelle, Brian Ripley, James R. Milks +2 more

#
This is actually an R-sig-mac question so I am responding there.


In general, if you want to install a new version without losing the 
previous packages,  using the finder, go to Library/Receipts and 
remove the R.app and R.Gui receipts.  Then install the new version. 
That will keep the previous packages.  This is not mysterious, this 
is R.


Thanks to Simon et al. for the upgrade.

Bill
At 11:00 PM -0400 8/27/08, Charilaos Skiadas wrote:

  
    
  
#
The standard R mechanisms for installing packages into a different library
apply on Mac OS X just as anywhere else.  It was not said that R was being 
run from the R.app GUI, but I'll assume that is the case.

The rw-FAQ provides detailed advice for Windows users: see

http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What_0027s-the-best-way-to-upgrade_003f
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#I-don_0027t-have-permission-to-write-to-the-R_002d2_002e7_002e2_005clibrary-directory

The differences for Mac OS users are small -- some of the names and how to 
set the library path via R_LIBS.

We arrange not to install packages within .Library on any of our systems 
-- and for most users they do not have permission to do so.
On Wed, 27 Aug 2008, William Revelle wrote:

            

  
    
#
So, what it boils down to is that I'm installing my packages at too  
high of a level (I'm an administrator for my system) and should save  
them in places other than the R framework folder.

Thanks too all for the tips and links.

Jim Milks
On Aug 28, 2008, at 5:08 AM, Prof Brian Ripley wrote:

            
#
On Aug 28, 2008, at 6:35 AM, James Milks wrote:

            
Exactly, and your situation is similar to mine. To answer Rolf's  
question about R_LIBS not being seen when you click R.app from the  
Finder, the answer is that any application run through the GUI does  
not at all read your shell login files, like .bash_profile or  
whatever else you are using. It inherits the Finder's environment  
instead of the shell's environment. There are two solutions:

1) Set R_LIBS in a file like .bash_profile, which is then read  
whenever a terminal window opens, and then every time start R.app  
from the terminal window via the command:
"open -a R". Then this R process will be inheriting the shell's  
environment.
2) Create a file ~/.MacOSX/environment.plist containing this R_LIBS  
definition, as specified in http://developer.apple.com/qa/qa2001/ 
qa1067.html. This file is respected by all GUI apps as well. Requires  
a system restart. If you go with this option, I would try to keep  
this file as minimal as possible.
Haris Skiadas
Department of Mathematics and Computer Science
Hanover College
#
On Aug 28, 2008, at 6:35 AM, James Milks wrote:

            
The update doesn't affect any package that you installed and the GUI  
remembers them (see R for Mac FAQ 5.2) - click on the search field pop- 
up in Package Installer and it will offer you to select all packages  
you have installed in the previous version of R.

In addition, trying to set R_LIBS via environment is a bad idea since  
there are so many ways R can be started, so please use .Rprofile  
or .Renviron as suggested in the documentation.

Cheers,
Simon