[Rd] R for Windows FAQ 2.8 suggestion

Roger Bivand Roger.Bivand at nhh.no
Sun Feb 24 12:13:56 CET 2008


The current text for: 2.8 What's the best way to upgrade? says:

"That's a matter of taste. For most people the best thing to do is to 
uninstall R (see the previous Q), install the new version, copy any 
installed packages to the library folder in the new installation, run 
update.packages() in the new R (`Update packages...' from the Packages 
menu, if you prefer) and then delete anything left of the old 
installation. Different versions of R are quite deliberately installed in 
parallel folders so you can keep old versions around if you wish."

The second paragraph can probably be dropped.

Following the 2.5/2.6 changes in primitive functions, as publicised in:

https://stat.ethz.ch/pipermail/r-help/2007-October/142367.html

I have found that users are confused, and that the advice to "copy any 
installed packages to the library folder in the new installation" is now 
unhelpful. The FAQ does mention (in various places) the benefits of having 
an installation library and one or more user libraries, but 2.8 seems to 
miss this. Could I suggest modifying it to something like:

"That's a matter of taste. If you do not have your own library where you 
have installed packages, you may want to record which there are before 
uninstalling the old version of R. This will return a character vector of 
package names:

z <- installed.packages(priority = "NA")[, "Package"]

which can be exported using save() to a safe place. Next uninstall the 
old version of R, install the new version, load your list of packages, and 
pass it to install.packages().

This can be tedious, involving more work than the alternative of having 
your own library for installing contributed packages - see references to 
setting the R_LIBS environment variable elsewhere in this document (e.g. 
4.2), and/or the help page for the .libPaths() function for help on 
creating and using such a library. If you have your own library, upgrading 
R is much simpler: uninstall the old version of R, install the new 
version, and run:

update.packages(checkBuilt=TRUE, ask=FALSE)

which will see whether packages in your own library need updating for the 
R build you have installed."

The text could be made more aggressive, by swapping the order and 
indicating that, in a Vista-esque world, installing in the release library 
directory is asking for trouble and deprecated. But I'm not sure about 
that.

Of course, I'm being very optimistic, hoping that users will read the FAQ, 
but at least they can be pointed to it when they get into trouble.

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-devel mailing list