Skip to content
Prev 18583 / 29559 Next

package 'raster' function 'clump'

Dear all,

are there any issues related to function 'clump', eg due to the update 
to the 3.0 version of R?

I tried to apply the function on a RasterLayer containing values 1-5. As 
a result it returns a RasterLayer containing value 1, only.

Thanks in advance.

example:

r <- raster(ncol = 10, nrow = 10)
r[] <- sample(x, size = 100, replace = TRUE)#1:ncell(r)
as.raster(r)
summary(r)


k <- clump(r, directions = 4, gaps = FALSE)
k