labcon {adehabitat} | R Documentation |
This function attributes unique labels to pixels belonging to connected
features on a map of class asc
.
labcon(x)
x |
an object of class asc |
Returns a matrix of class asc
, of type "factor"
, with a
number of levels equals to the number of connected components
Clement Calenge clement.calenge@oncfs.gouv.fr
asc
for further information on the class asc
data(puechabon) hr <- getsahrlocs(puechabon$sahr, "hr") u <- getkasc(hr, "Jean") image(u) ## numbering of the connected components p <- labcon(u) nlevels(p) image(p) ## stores the first component c1 <- p c1[c1 != 1] <- NA image(c1) ## stores the second component c2 <- p c2[c2 != 2] <- NA image(c2)