Detect edges. Edges are those cells who have more than one class in the 9 cells surrounding it, or, if classes=FALSE, cells with values and cells with NA.
Usage
edge(x, ...)
Arguments
x
a Raster* object
...
Additional arguments, see Details
Value
a RasterLayer. Cell values are either 1 (and edge) or 0 (not an edge)
Details
The following additional arguments can be passed:
rll{
classes Logical. If TRUE all different values are (after rounding) distinguished, as well as NA. If FALSE, the only comparison is between values and NAtype Character. 'both' (default), 'inner', or 'outer' to distinguish cells with values versus cells with NA.
asNA Logical. Should non-edge cells by NA rather than FALSE (zero)?
asZero Logical. If asNA=TRUE, should cells that are not an edge, and not NA on the input RasterLayer be returned as zero?
filename Character. Filename for the output RasterLayer
format Character. Output file type. See writeRasterdatatype Character. Output data type. See dataTypeoverwrite Logical. If TRUE, "filename" will be overwritten if it exists
progress Character. "text", "window", or "" (the default, no progress bar)
}