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
Problem with update.packages on repo with a single package
3 messages · Michael DiPersio, Uwe Ligges
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.
Uwe Ligges wrote:
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.
Whoops, no! Already fixed this morning by Brian Ripley. So, pelase don't send! Thanks again, Uwe
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.