On Thu, Jan 3, 2013 at 7:06 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
Happy 2013 to everyone! Thanks Barry, very useful page. Nevertheless, I think the equivalent to zlim in plot() should be included also, because most of the time we use standard palettes that must be applied to the particular range of interest of the raster(s) (note real raster data often has outliers), i.e.: plot(r,col=matlab.like(64),zlim=c(20,50))
My only concern here was with categorical rasters, where the values (and hence the colours) are only meaningful with a label. For example 20=Deciduous Forest, 21=PIne Forest, 22=Burnt Forest, 10=Meadow, 12=Urban, and so on. In this context I don't see a need to restrict plotting with zlim because the idea of 'limits' for a non-continuous variable is a bit odd. You might want to get all the forest-related variables and so plot everything from 20 to 29, but if your interest is forestry then you should probably select those categories from the raster into a new raster. My intention wasn't to create a generic value-colour palette handling system. I've also written some code that works with legend to display legends for categorical data. I don't really want to release it until the raster package decides what RasterLegend objects are all about... Barry