Subject: Re: image stops detecting wrong sized z matrix (PR#352)
Date: Wed 01 Dec 1999 - 00:16:55 EST
> 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
> 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, firstname.lastname@example.org 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: email@example.com _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:11 EST