Michael DiPersio
2009-May-06 04:03 UTC
[R] Problem with update.packages on repo with a single package
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
Uwe Ligges
2009-May-06 08:52 UTC
[R] Problem with update.packages on repo with a single package
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.
Apparently Analagous Threads
- getWinProgressBar does not return previous value
- [Bug 1468] New: sshd does not log failed attempts using key-based authentication only
- Quick Question about R
- 5 commits - libswfdec/Makefile.am libswfdec/swfdec_color.c libswfdec/swfdec_color.h libswfdec/swfdec_font.c libswfdec/swfdec_loadertarget.c libswfdec/swfdec_movie.h libswfdec/swfdec_pattern.c libswfdec/swfdec_pattern.h libswfdec/swfdec_player.c