[R] Problem with update.packages on repo with a single package

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed May 6 10:52:34 CEST 2009


Is this R-2.9.0?
If so, please submit to R-bugs so that the bugfix does not get lost.
Otherwise, please try R-2.9.0 patched and submit a patch against that 
version.

Thank you very much!
Uwe Ligges



Michael DiPersio wrote:
> I've set up a CRAN-style repository to distribute a single package.  The 
> repository contains several versions of the package, I was hoping that 
> update.packages pointed at this repository would grab the highest 
> version number.  In fact it returns an error:
> 
> Error in available[, "Bundle"] : incorrect number of dimensions
> 
> This is because the private function .remove_stale_dups in utils, which 
> is supposed to return a copy of an available.packages matrix with no 
> duplicates, does not return a matrix in the case where all available 
> packages are stale except one.  To fix this I've made the following 
> simple change to the utils package in my copy of R, but if I've 
> overlooked something I'd be happy to hear about it:
> 
> Index: packages.R
> ===================================================================
> --- packages.R    (revision 48465)
> +++ packages.R    (working copy)
> @@ -869,5 +869,5 @@
>         stale_dups[i:end_i] <- wh
>         i <- end_i + 1L
>     }
> -    if(length(stale_dups)) ap[-stale_dups, ] else ap
> +    if(length(stale_dups)) ap[-stale_dups,,drop=FALSE ] else ap
> }
> 
> Thanks,
> 
> Michael DiPersio
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list