Hi, I am trying to use image() function in R and for the set of the x-locations I am providing, it keeps giving me an error: Error in image(as.double(x), as.double(y), as.integer(zi), col) : invalid x / y values or limits I have looked over the cases which inclusion causes the message but could not identify the problem. I did notice that it does not l accept non-unique x-values (the other message was about ascending order ) and removed those. I know that the error is due to "x-values" since when i supply arbitrary equally spaces locations, the function works fine. Any ideas what the error message i get may refer to? Thank you! Jane -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 31 Oct 2001, Jane Fridlyand wrote:> I am trying to use image() function in R and for the set of the > x-locations I am providing, it keeps giving me an error: > > Error in image(as.double(x), as.double(y), as.integer(zi), col) : > invalid x / y values or limits > > I have looked over the cases which inclusion causes the message but > could not identify the problem. I did notice that it does not l accept > non-unique x-values (the other message was about ascending order ) and > removed those. I know that the error is due to "x-values" since when i > supply arbitrary equally spaces locations, the function works fine. > > Any ideas what the error message i get may refer to?It's from the C code in plot3d.c. It happens if 1) x or y is of length 0. 2) any element of x or y is not finite (infinite or NA or NaN) 3) the x or y values are not strictly increasing. My guess is that you have 2, but debug image.default and print x and y just prior to the .Internal call to find out. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, 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-help mailing list -- Read ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> > I am trying to use image() function in R and for the set of the > x-locations I am providing, it keeps giving me an error:Here is an example for you to follow. Suppose you have a datafile in this form: x y z 1 1 1 1 2 2 1 3 5 2 1 3 2 2 9 2 3 2 3 1 8 3 2 4 3 3 7 data<-read.table("rstuff/data.dat",header=TRUE) image(unique(data$x),unique(data$y),data$z, col=gray(19:0/19)) Bill -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._