[R-sig-Geo] eculidean threshold for clustering
Roger.Bivand at nhh.no
Tue Oct 26 13:05:06 CEST 2010
On Tue, 26 Oct 2010, jgarcia at ija.csic.es wrote:
> Dear all,
> I am wondering if there is a direct function (I cannot find any) in R, to
> obtain, a "factor" vector to identify which points could be grouped in a
> set, using a specific threshold distance as clustering criterion.
> #e.g, with 7 points with coordinates:
> x <- c(1.01,0.95,1.05,1.03,3.03,2.99,3.04)
> y <- c(3.01,3.02,3.04,5.23,2.01,2.02,1.98)
dnb <- dnearneigh(cbind(x, y), 0, 0.5)
#  1 1 1 2 3 3 3
> # and, let's say, distance threshold 0.5, the answer would be:
> # where the threshold is the maximum distance between any two points for
> each cluster
> A better approach would be that threshold could be specified as the
> distance between any point in each cluster, and its corresponding center
> of mass for that cluster, but I guess this would require some loops. Isn't
> it? S, I would be happy enough with the abovementioned approach.
I think that this might need hierarchical clustering and custom cut-offs
and # clusters.
Hope this helps,
> If there isn't a direct function, don't worry. I'll try to find a solution
> computing distances...
>> is it possible to load a complete Grass mapset into a raster stack or
>> with a single command?
>> View this message in context:
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo