[R] [fields] image.plot abends with NAs in image.plot.info

Tom Roche Tom_Roche at pobox.com
Wed Feb 15 16:40:53 CET 2012


Tom Roche Fri, Feb 3, 2012 at 11:16 AM
>> summary: image.plot-ing two sets of netCDF data, with the second
>> derived from the first.

Should have noted that the data (atmospheric emissions) in

* the second dataset is heavily positively-skewed. (This leads to a
  problem with the legend when plotting deciles--all but one or two of
  the decile labels overprint near the bottom of the scale--but will
  post separately about that.)

* the first dataset is much more evenly distributed over its range.
  (This is due to a bug in its logging, hence the need to correct it.)

>> First plots to PDF as expected (title, data, legend). Second plots
>> the data and title, but abends before drawing the legend

Doug Nychka Mon, 13 Feb 2012 21:33:36 -0700 (rearranged)
> The error you are getting means that at the first step
> image.plot.info is not finding the range correctly.
> Please make sure that 

>    x.cell.centers.km  y.cell.centers.km, 

> are vectors

I checked (by printf-ing the code): they have class=numeric and the
expected length.

> and

>    target.datavar[,,i.layer]

> is a matrix.

Yes: it has class=matrix and the expected dimensions.

> Also try calling image.plot with the data in a list form:

> obj<- list( x= x.cell.centers.km, y= y.cell.centers.km,
>             z=  target.datavar[,,i.layer])
> image.plot( obj)

PLOTS! Thanks, but :-) given the non-list call works on the more-
evenly-distributed source data, but fails on the skewed target data,
there would seem to be a bug, if only in the doc. (If you've got a
bugzilla or similar, please let me know, and I will make an entry.)

Your assistance is appreciated! Tom Roche <Tom_Roche at pobox.com>



More information about the R-help mailing list