[R-sig-eco] Finding 'clumps' of individuals in transect data

David Bryan drbryan02 at yahoo.com
Tue Sep 26 01:17:27 CEST 2017


I am looking for an algorithm that would help me find and quantifyclumps of values in a vector.  My datainclude a count of individuals at every meter along a line transect line.


 
Two constraints:

1) I would like the clump size to be consistent (i.e. include only 10 consecutivelocations)

2) I am interested in maximum total values for clumps and do not want values from a single location to be used in the calculations formore than one clump.  For example iftotal number of individuals counted from locations 2-11 = 14 and the totalnumber of individuals from locations 5-14 =20 I would only like to identify the latterclump because it is larger and there is overlap between the two possible clumps from locations 5-11. 


 
My data look something like this:


 
location<-seq(from=1, to=1000,by=1)

dat<-data.frame(location)

dat$count<-rbinom(round(1000), 1, .1)

dat$count[dat$count==1]<-round(sample(runif(sum(dat$count), 1,10),replace=T))


Thanks,
David
	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list