[Rd] robustness of install.packages/update.packages

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Aug 31 11:33:23 CEST 2005


On Mon, 29 Aug 2005, Prof Brian Ripley wrote:

> On Sun, 28 Aug 2005, Prof Brian Ripley wrote:
>
>>> After redirecting R 2.1.1 on my laptop to use
>>>        http://cran.au.r-project.org/
>>> for the CRAN repository, the install.packages() command ran without
>>> problems.  I issued the command `library(MASS)' and tried out the
>>> example from fitdistr on that machine (same strange result for second
>>> command and warning messages were issued).  So I said
>>> update.packages()  and that command failed when it wanted to update
>>> the MASS package.  So I detach()'ed MASS and re-ran update.packages()
>>> and again it failed.  So I exited R 2.1.1 and restarted it again
>>> (probably I should have unloaded the namespace of MASS??) and then the
>>> update.packages command worked.
>> 
>> Yes, and that *is* in the rw-FAQ.
>> 
>>> However, update.packages() wanted to update quite a few packages
>>> besides MASS (the other packages in the VR bundle, nlme, lattice &c).
>>> Once it failed on MASS, it terminated with an error and did not update
>>> any of the other packages.  Would it be possible to robustify
>>> update.packages behaviour such that it would continue in such
>>> situations with updating the remaining packages?
>> 
>> Not a good idea. Better to follow the FAQ.  At that point the dependencies
>> have been worked out and will not be re-computed if a package installation
>> fails.
>
> I checked, and I am unable to reproduce this.  I get

The difference here was that it is install.packages("VR") which 
update.packages() uses, not install.packages("MASS"), and of course "VR" 
is not a package.

I've altered the code to check if any package in a bundle is in use.  We 
can only do that if installing from a repository (not a local zip file), 
but at least we can cover than base.

I've also changed the code to use warning() and not stop() if moving fails 
(although that is likely to be quite a serious problem).

>
>> library(MASS)
>> install.packages(c("MASS", "tree"))
> trying URL 
> 'http://cran.at.r-project.org/bin/windows/contrib/2.2/tree_1.0-19.zip'
> Content type 'application/zip' length 144676 bytes
> opened URL
> downloaded 141Kb
>
> package 'tree' successfully unpacked and MD5 sums checked
>
> The downloaded packages are in
>        C:\Documents and Settings\ripley\Local 
> Settings\Temp\Rtmp13777\downloaded_packages
> updating HTML package descriptions
> Warning message:
> package MASS is in use and will not be installed
>
> which seems perfectly reasonable.
>
>
>
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list