albrecht.gebhardt@uni-klu.ac.at
1999-Nov-30 13:28 UTC
image stops detecting wrong sized z matrix (PR#352)
Full_Name: Albrecht Gebhardt Version: 0.90.0 OS: Linux + Tru64 Submission from: (NULL) (143.205.61.72) This is where example(krige) from library(sgeostat) stops with R 0.90.0: krige> image(grid$x, grid$y, grid$krige$zhat, add = T) Error in length(x) == nrow(z) : comparison (1) is possible only for vector types in previous versions of R the above image() call worked, because image() did the transformation grid$krige$zhat -> matrix(grid$krige$zhat,length(grid$x),length(grid$x)) iself. (BTW, contour() didn't) Was this change of behaviour in image() made intentionally? Anyway I will change the Rd help page for krige in sgeostat to ... image(grid$x, grid$y, matrix(grid$krige$zhat,length(grid$x),length(grid$x)), add = T) ... Albrecht -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk
1999-Nov-30 14:16 UTC
image stops detecting wrong sized z matrix (PR#352)
[...]> This is where example(krige) from library(sgeostat) stops with R 0.90.0: > > krige> image(grid$x, grid$y, grid$krige$zhat, add = T) > Error in length(x) == nrow(z) : comparison (1) is possible only for vector > types > > in previous versions of R the above image() call worked, because image() > did the transformation > > grid$krige$zhat -> matrix(grid$krige$zhat,length(grid$x),length(grid$x)) > > iself. (BTW, contour() didn't)(In fact, it just ignored dim(z) which therefore could be null.)> Was this change of behaviour in image() made intentionally?Yes, to allow a more general specification of x and y, for S compatibility (and general usefulness!). I believe this is a bug in sgeostat not in R: it has long been documented that z should be a matrix. What has happened is that we now make use of the documented behaviour. Suppose z were of length 90, and each of x and y were of length 10. That is now ambiguous (and BTW, just gave the wrong plot in 0.65.1, something that has caught me more than once). I will add a more specific error message testing that z is a matrix. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._