[R] image function

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Nov 1 09:43:02 CET 2001

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,  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-help 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-help-request at stat.math.ethz.ch

More information about the R-help mailing list