[R-sig-Geo] raster package display

Colin Robertson colinr23 at gmail.com
Wed Jun 29 17:50:18 CEST 2011


Dear List,

I am creating a raster as the output of a function, and for testing
purposes the output of this function should be a raster with all 1's.

When I check with summary, this is the case:

class(out[[2]])
[1] "RasterLayer"
attr(,"package")
[1] "raster"

summary(out[[2]])
Cells:  1600
NAs  :  304

Min.      1
1st Qu.   1
Median    1
Mean      1
3rd Qu.   1
Max.      1
NA's    304

Yet when I plot using plot(out[[2]]), I get a display of values
ranging from 0.6 - 1.4.

All summaries on the raster indicates all cells have value of 1, but
the display shows differently.

Any ideas on what is happening here much appreciated,

Thanks -

Colin



More information about the R-sig-Geo mailing list