Closed MichaelChirico closed 4 years ago
From: Prof Brian Ripley <ripley@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> [...]
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@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ <CENSORING FROM DETECTED PHONE NUMBER ONWARDS; SEE BUGZILLA>
NOTES: This was a change to agree with the documentation (and S)
Audit (from Jitterbug): Fri Dec 10 17:06:05 1999 ripley changed notes Fri Dec 10 17:06:06 1999 ripley moved from incoming to Graphics-fixed
From: albrecht.gebhardt@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>-klu.ac.at 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
METADATA