From barry.rowlingson at gmail.com  Thu Oct 20 18:41:37 2005
From: barry.rowlingson at gmail.com (barry.rowlingson@gmail.com)
Date: Thu, 20 Oct 2005 18:41:37 +0200 (CEST)
Subject: [Rd] image() with all NAs fails (PR#8228)
Message-ID: <20051020164137.AD1E220BFF@slim.kubism.ku.dk>

Full_Name: Barry Rowlingson
Version: 2.2.0
OS: Linux
Submission from: (NULL) (194.80.32.8)


The image function with a matrix of all NA values fails with:

> xyz=list(x=1:3,y=1:4,z=matrix(NA,3,4))
> image(xyz)
Error in image.default(xyz) : invalid z limits
In addition: Warning messages:
1: no finite arguments to min; returning Inf
2: no finite arguments to max; returning -Inf

Image can handle any number of NAs as long as there is at least one data value:

> xyz=list(x=1:3,y=1:4,z=matrix(c(1,rep(NA,11)),3,4))
> image(xyz)

 and shows NAs as transparent. However if it is all NAs then the z-limit
calculation breaks down as above.

  It seems reasonable to me that image() with all NAs should produce a
completely transparent/empty image (after displaying the axes if add!=TRUE) and
not fail with an error.

Barry



[Rd] image() with all NAs fails (PR#8228)
barry.rowlingson@gmail.com