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@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.

Reply via email to