Skip to content

cluster points within a given distance

2 messages · Frederico Mestre, Marcelino de la Cruz

#
Let's say that your data.frame with the x and y coordnates is call
"cosaxy"

A possible option would be:

cosa.cc <- hclust(dist(cosaxy), "complete")
cosa.35<- cutree(cosa.cc, h=35)

cosa.35 is a vector that assign each point to a cluster that have a
distance between their points less or equal than 35.


HTH

Marcelino



Con fecha 31/7/2012, "Frederico Mestre" <mestre.frederico at gmail.com>
escribi?: