[Rd] update.packages(1)

Arni Magnusson arnima at hafro.is
Thu Mar 25 20:16:06 CET 2010


I'm relaying a question from my institute's sysadmin:

Would it be possible to modify update.packages() and related functions so 
that 'lib.loc' accepts integer values to specify a library from the 
.libPaths() vector?

Many Linux users want to update all user packages (inside the R_LIBS_USER 
directory, e.g. ~/r/library) and none of the system packages (inside the 
/usr directory, e.g. /usr/lib64/R/library), because they don't have write 
privileges to update the system packages.

Currently, this can be done by pressing 'y RET' for all the user packages 
and 'RET' for all the system packages. This hard work and careful reading 
when there dozens of packages. Another way is to run

   update.packages(Sys.getenv("R_LIBS_USER"))

or:

   update.packages(.libPaths()[1])

But it would be nicer for the user to type

   update.packages(1)

using a 'pos' like notation to indicate the first element of the 
.libPaths() vector.

---

A separate but related issue is that it would be nice if the R_LIBS_USER 
library would be the first library by default. Currently, my sysadmin must 
use Rprofile.site to shuffle the .libPaths() to make R_LIBS_USER first, 
which seems like a sensible default when it comes to install.packages() 
and remove.packages().

This is R version 2.10.1 (2009-12-14) on x86_64-redhat-linux-gnu (Fedora 
11).

Thanks,

Arni



More information about the R-devel mailing list