Hello All, I'm getting this error (Version: 1.9.0-1 on a debian system)> update.packages("mgcv")trying URL `ftp://mirror.aarnet.edu.au/pub/cran/src/contrib/PACKAGES' ftp data connection made, file length 169516 bytes opened URL .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..... downloaded 165Kb Error in "colnames<-"(`*tmp*`, value = c("Package", "LibPath", pkgFlds)) : attempt to set colnames on object with less than two dimensions The relevant section of the package file is: Package: mgcv Version: 1.0-8 Author: Simon Wood Maintainer: Simon Wood Title: Multiple smoothing parameter estimation and GAMs by GCV Description: Routines for GAMs and other generalized ridge regression with multiple smoothing parameter selection by GCV or UBRE. Also GAMMs by REML or PQL. Includes a gam() function. Priority: recommended Depends: R (>= 1.9.0), nlme (>= 3.1-40), MASS (>= 7.1-11) License: GPL version 2 or later Packaged: Wed May 26 11:17:05 2004; simon Is the error a result of something I can't see in the format of this? I'm guessing it must be because its occuring before the download attempts, so R won't have seen the actual package file? ---- Robert King, Statistics, School of Mathematical & Physical Sciences, University of Newcastle, Australia Room V133 ph +61 2 4921 5548 Robert.King at newcastle.edu.au http://maths.newcastle.edu.au/~rking/ "It's easy to lie with statistics. It's even easier to lie without them." -- Frederick Mosteller
Problem solved. This is a bad interaction of packages installed from debian with the R update.packages() system. Moral of the story is don't try to update.packges() for any of the packages installed as r-cran-package.name.here debian packages. Robert. On Thu, 3 Jun 2004, Robert King wrote:> Hello All, > > I'm getting this error (Version: 1.9.0-1 on a debian system) > > > update.packages("mgcv") > trying URL `ftp://mirror.aarnet.edu.au/pub/cran/src/contrib/PACKAGES' > ftp data connection made, file length 169516 bytes > opened URL > .......... .......... .......... .......... .......... > .......... .......... .......... .......... .......... > .......... .......... .......... .......... .......... > .......... ..... > downloaded 165Kb > > Error in "colnames<-"(`*tmp*`, value = c("Package", "LibPath", pkgFlds)) : > attempt to set colnames on object with less than two dimensions > > The relevant section of the package file is: > > Package: mgcv > Version: 1.0-8 > Author: Simon Wood > Maintainer: Simon Wood > Title: Multiple smoothing parameter estimation and GAMs by GCV > Description: Routines for GAMs and other generalized ridge regression > with multiple smoothing parameter selection by GCV or UBRE. > Also GAMMs by REML or PQL. Includes a gam() function. > Priority: recommended > Depends: R (>= 1.9.0), nlme (>= 3.1-40), MASS (>= 7.1-11) > License: GPL version 2 or later > Packaged: Wed May 26 11:17:05 2004; simon > > Is the error a result of something I can't see in the format of this? I'm > guessing it must be because its occuring before the download attempts, so > R won't have seen the actual package file? > > > ---- > Robert King, Statistics, School of Mathematical & Physical Sciences, > University of Newcastle, Australia > Room V133 ph +61 2 4921 5548 > Robert.King at newcastle.edu.au http://maths.newcastle.edu.au/~rking/ > > "It's easy to lie with statistics. It's even easier to lie without them." > -- Frederick Mosteller >---- Robert King, Statistics, School of Mathematical & Physical Sciences, University of Newcastle, Australia Room V133 ph +61 2 4921 5548 Robert.King at newcastle.edu.au http://maths.newcastle.edu.au/~rking/ "It's easy to lie with statistics. It's even easier to lie without them." -- Frederick Mosteller
Martin Maechler
2004-Jun-03 07:36 UTC
[R] bug in installed.packages {was "Problem... mgcv PACKAGES file.."}
Hi Robert,>>>>> "Robert" == Robert King <robert.king at newcastle.edu.au> >>>>> on Thu, 3 Jun 2004 16:58:16 +1000 (EST) writes:Robert> Hello All, I'm getting this error (Version: 1.9.0-1 Robert> on a debian system) >> update.packages("mgcv") Robert> trying URL Robert> `ftp://mirror.aarnet.edu.au/pub/cran/src/contrib/PACKAGES' Robert> ftp data connection made, file length 169516 bytes Robert> opened URL Robert> .......... .......... .......... .......... .......... Robert> .......... .......... .......... .......... .......... Robert> .......... .......... .......... .......... .......... Robert> .......... ..... downloaded 165Kb Robert> Error in "colnames<-"(`*tmp*`, value = c("Package", Robert> "LibPath", pkgFlds)) : attempt to set colnames on Robert> object with less than two dimensions I can confirm the problem (with R 1.9.1 alpha of a few days ago) It's not related to "mgcv" at all. For didactical purposes I show here how to find out more (i.e. how to start learning to debug):> update.packages("sfsmisc")trying URL `http://cran.ch.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=ISO-8859-1' length 169516 bytes opened URL .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..... downloaded 165Kb Error in "colnames<-"(`*tmp*`, value = c("Package", "LibPath", pkgFlds)) : attempt to set colnames on object with less than two dimensions [same bug --- now one crucial thing to learn : ] --------------------------> traceback()5: stop("attempt to set colnames on object with less than two dimensions") 4: "colnames<-"(`*tmp*`, value = c("Package", "LibPath", pkgFlds)) 3: installed.packages(lib.loc = lib.loc) 2: old.packages(lib.loc = lib.loc, contriburl = contriburl, method = method, available = available) 1: update.packages("sfsmisc") [ok, it's inside installed.packages() that the problem occurs; hence let's look inside there : ]> debug(installed.packages) > update.packages("sfsmisc")trying URL `http://cran.ch.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=ISO-8859-1' length 169516 bytes opened URL .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..... downloaded 165Kb debugging in: installed.packages(lib.loc = lib.loc) debug: { if (is.null(lib.loc)) lib.loc <- .libPaths() pkgFlds <- c("Version", "Priority", "Bundle", "Depends") if (!is.null(priority)) { if (!is.character(priority)) stop("`priority' must be character or NULL") if (any(b <- priority %in% "high")) priority <- c(priority[!b], "recommended", "base") } retval <- character() for (lib in lib.loc) { pkgs <- .packages(all.available = TRUE, lib.loc = lib) for (p in pkgs) { desc <- unlist(packageDescription(p, lib = lib, fields = pkgFlds)) if (!is.null(priority)) if (is.na(pmatch(desc["Priority"], priority))) next retval <- rbind(retval, c(p, lib, desc)) } } if (!is.null(retval)) colnames(retval) <- c("Package", "LibPath", pkgFlds) retval } Browse[1]> debug: if (is.null(lib.loc)) lib.loc <- .libPaths() Browse[1]> debug: pkgFlds <- c("Version", "Priority", "Bundle", "Depends") Browse[1]> debug: if (!is.null(priority)) { if (!is.character(priority)) stop("`priority' must be character or NULL") if (any(b <- priority %in% "high")) priority <- c(priority[!b], "recommended", "base") } Browse[1]> debug: retval <- character() Browse[1]> debug: for (lib in lib.loc) { pkgs <- .packages(all.available = TRUE, lib.loc = lib) for (p in pkgs) { desc <- unlist(packageDescription(p, lib = lib, fields = pkgFlds)) if (!is.null(priority)) if (is.na(pmatch(desc["Priority"], priority))) next retval <- rbind(retval, c(p, lib, desc)) } } Browse[1]> debug: lib Browse[1]> debug: pkgs <- .packages(all.available = TRUE, lib.loc = lib) Browse[1]> debug: for (p in pkgs) { desc <- unlist(packageDescription(p, lib = lib, fields = pkgFlds)) if (!is.null(priority)) if (is.na(pmatch(desc["Priority"], priority))) next retval <- rbind(retval, c(p, lib, desc)) } Browse[1]> debug: if (!is.null(retval)) colnames(retval) <- c("Package", "LibPath", pkgFlds) Browse[1]> retval character(0) Browse[1]> Error in "colnames<-"(`*tmp*`, value = c("Package", "LibPath", pkgFlds)) : attempt to set colnames on object with less than two dimensions>---------------- If look at the last dozen lines the bug is "obvious" ["Good Programming rule": !is.null(.) is NOT the same as length(.) > 0 ] What I don't understand is that it took so long before the problem was seen by someone... It also seems to me that the value of lib.loc (namely "sfsmisc") at that moment is wrong as well - which would point to a problem in the update.packages() function... Well, anyway, more details belong to R-bugs / R-devel, not here (R-help). Martin Maechler
On Thu, Jun 03, 2004 at 04:58:16PM +1000, Robert King wrote:> Hello All, > > I'm getting this error (Version: 1.9.0-1 on a debian system) > > > update.packages("mgcv")[... snip ...] Try $ apt-get -t unstable install r-cran-mgcv as mgcv is (obviously, given its 'recommend' status) one of the CRAN packages in Debian itself. Not sure why your built failed, though. Ours seem to work, witness the autobuilder logs at http://buildd.debian.org/build.php?pkg=mgcv r-cran-mgcv should migrate from unstable to testing in the usual 10 day window. Hth, Dirk -- FEATURE: VW Beetle license plate in California