[R] packages across different versions of R

David Winsemius dwinsemius at comcast.net
Wed Jul 23 04:50:15 CEST 2014

On Jul 21, 2014, at 4:53 AM, Prof Brian Ripley wrote:

> On 21/07/2014 12:24, Charles Thuo wrote:
>>  I have just installed R 3.1.1 in a machine where R 3.0.1 is already
>> installed.  Is it possible to use packages in the 3.0.1 on the 3.1.1.
>> version as the same are in a single workstation.
> Perhaps, perhaps not.  It depends in part on your platform which you have not told us (see the posting guide).  It is definitely safer to reinstall them.  For Window users see http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What_0027s-the-best-way-to-upgrade_003f : similar ideas work for other platforms.
> The place where using packages for 3.0.1 is least likely to work is OS X, but there installing a new binary version of R by default removes earlier installations.

It does? That has not been my experience, and I thought that Simon has repeatedly said that the opposite was true. At least for me the older versions persist as well as the packages residing in the library/ directory (and I do not remember overriding any defaults).

(I just needed some extra space this weekend and found that some of the packages with genomic data were taking up quite a bit of space in the 2.15 and 3.0 version Resources/library/ folders.

I thought the usual advice (which is part of the FAQ you linked to)  was to copy the contents of the Versions/<ver-no>/Resources/library/ directory from the prior version to the new similarly named directory and then run:

# I added that second argument b/c I have a large collection

(This doesn't work for packages only available on r-forge or github.)
David Winsemius
Alameda, CA, USA

More information about the R-help mailing list