cclFun {sperich} | R Documentation |
Connected Component Labeling
Description
This routine identifies disjunct patches within a distribution matrix.
Usage
cclFun(mat)
Arguments
mat |
Matrix with 0 as background value and positive values as occurrences to check patches for. |
Details
This routine identifies disjunct patches of positive values within a matrix containing zeros as background values.
Value
This function returns a matrix with zero as background value and positive values numbering and representing the disjunct patches.
Author(s)
Maximilian Lange
Examples
## example data
tmat = { matrix(c( 0,0,0,1,0,0,1,1,0,1,
0,0,1,0,1,0,0,0,0,0,
0,1,NA,1,0,1,0,0,0,1,
1,0,1,1,1,0,1,0,0,1,
0,1,0,1,0,1,0,0,0,1,
0,0,1,0,1,0,0,1,1,0,
1,0,0,1,0,0,1,0,0,1,
0,1,0,0,0,1,0,0,0,1,
0,0,1,1,1,0,0,0,0,1,
1,1,1,0,0,0,0,0,0,1),
nr=10,byrow=TRUE) }
ccl.mat <- cclFun(tmat)
[Package sperich version 1.5-9 Index]