Dear Benno,

If there are no NA values, getting only one clump is the expected behaviour.

clump detects the "islands" between the NA values. In your case, you create one island covering the whole raster.

Note that your example is not reproducible. x is not defined.

See if the example in ?clump runs.

Best,

Jacob.


________________________________
 From: Benno N. Dillinger <benno.dillinger@gmail.com>
To: r-sig-geo@r-project.org 
Sent: Saturday, 22 June 2013, 11:13
Subject: [R-sig-Geo] 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

-- 

B. N. Dillinger, Bakk.techn.

Tel.: +43 (0)680 - 2328849

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
	[[alternative HTML version deleted]]

