boundaries.RdDetect boundaries (edges). boundaries are cells that have more than one class in the 4 or 8 cells surrounding it, or, if classes=FALSE, cells with values and cells with NA.
# S4 method for class 'RasterLayer'
boundaries(x, type='inner', classes=FALSE, directions=8, asNA=FALSE, filename="", ...)RasterLayer object
character. 'inner' or 'outer'
character. Logical. If TRUE all different values are (after rounding) distinguished, as well as NA. If FALSE (the default) only edges between NA and non-NA cells are considered
integer. Which cells are considered adjacent? Should be 8 (Queen's case) or 4 (Rook's case)
logical. If TRUE, non-edges are returned as NA instead of zero
character. Filename for the output RasterLayer (optional)
additional arguments as for writeRaster
RasterLayer. Cell values are either 1 (a border) or 0 (not a border), or NA