Description Usage Arguments Value Note Author(s) Examples
Detect clumps (patches) of connected cells. Each clump gets a unique ID. NA and zero are used as background values (i.e. these values are used to separate clumps). You can use queen's or rook's case, using the directions
argument. For larger files that are processed in chunks, the highest clump number is not necessarily equal to the number of clumps (unless you use argument gaps=FALSE
).
1 2 |
x |
RasterLayer |
filename |
Character. Filename for the output RasterLayer (optional) |
directions |
Integer. Which cells are considered adjacent? Should be 8 (Queen's case) or 4 (Rook's case) |
gaps |
Logical. If |
... |
Additional arguments as for |
RasterLayer
This function requires that the igraph package is available.
Robert J. Hijmans and Jacob van Etten
1 2 3 4 5 6 |
Loading required package: sp
Loading required namespace: igraph
value count
[1,] 1 1
[2,] 2 12
[3,] 3 2
[4,] 4 10
[5,] 5 1
[6,] 6 3
[7,] 7 1
[8,] 8 2
[9,] 9 4
[10,] 10 2
[11,] 11 1
[12,] 12 1
[13,] NA 104
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.