Learn R Programming

raster (version 1.8-3)

cut: Convert values to classes

Description

Cut uses the base function 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.

Usage

cut(x, ...)

Arguments

x
A Raster* object
...
additional arguments. See cut

Value

  • Raster* object

See Also

subs, reclass, calc

Examples

Run this code
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