[R] can update.packages Debian package files?

Dirk Eddelbuettel edd at debian.org
Sun Nov 5 03:14:59 CET 2006


Tamas,

Great question. 

On 4 November 2006 at 11:55, Tamas K Papp wrote:
| I have searched the archive for the solution of this question, but
| couldn't find anything, so I thought I would ask here.

It has been discussed not that long ago on r-sig-debian, feel free to
subscribe there as you may find the list useful for all matters Debian and R.

| I am using R on a Debian (testing) system.  Many of the R packages I
| use are installed as .deb packages, those which are not available in
| this format I install using install.packages.
| 
| When calling update.packages, sometimes the R repository version is
| more recent than the Debian package, and update.packages offers to
| update it which I don't want because the new debianized version will
| be out soon.  Is it possible to have update.packages recognize that
| these are "systemwide" packages and ignore them when updating?  Or is
| manual selection of what to update the only option?

Let's recall that we have three locations for R packages under Debian (and
hence also Ubuntu et al):

i)   /usr/lib/R/library
		used *exclusively* by r-base-core (and e.g. not even by
		r-recommended such as r-cran-vr, r-cran-boot, ...)

ii)  /usr/lib/R/site-library
		used *exclusively* by Debian (or Ubuntu) supplied packages
		that you can updated with apt-get et al (provided the
		maintainer stays current)

iii) /usr/local/lib/R/site-library
		used for the rest

The key is that these are non-overlapping which you can employ with
update.packages() provided you tell update.packages() to limit itself to
the directory in iii).  Which is as simple as saying

	> update.packages(lib.loc="/usr/local/lib/R/site-library")

Now, for added bonus, the script 'update.r' in the littler package (version
0.0.8 or later) does all that for you. So after an initial

	$ sudo apt-get install littler 

all you need is

	$ sudo /usr/share/doc/littler/examples/update.r

Cheers, Dirk



-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison



More information about the R-help mailing list