cut
to divides the range of the values of a Raster* object into intervals and codes the values in x according to which interval they fall. The leftmost interval corresponds to level one, the next leftmost to level two and so on.cut(x, ...)
subs, reclass, calc
r <- raster(ncols=36, nrows=18)
r[] <- rnorm(ncell(r))
breaks=-2:2 * 3
rc <- cut(r, breaks=breaks)
Run the code above in your browser using DataLab