Re: [R] R and Clusters

2008-01-07 Thread Gabor Csardi
On Mon, Jan 07, 2008 at 05:25:44PM +0100, Lorenzo Isella wrote: > Thanks for both the replies. > I am now giving a try to the suggestion by Gabor since it looks easier > (for me) to implement. > I am testing it, but so far it does what I have in mind. > I am going now through the documentation of t

Re: [R] R and Clusters

2008-01-07 Thread Lorenzo Isella
Thanks for both the replies. I am now giving a try to the suggestion by Gabor since it looks easier (for me) to implement. I am testing it, but so far it does what I have in mind. I am going now through the documentation of the igraph package. I can count the cluster number, but I also want to make

Re: [R] R and Clusters

2008-01-07 Thread Christian Hennig
Dear Lorenzo, if I understand your posting correctly, this is exactly what Single Linkage clustering does if you cut the dendrogram tree at your threshold distance. Therefore you can use hclust with method="single" (which produces the full dendrogram; you have to generate the Euclidean distanc

Re: [R] R and Clusters

2008-01-07 Thread Gabor Csardi
Lorenzo, why can't you actually generate the graph to find the connection components? With the 'igraph' package this is something like: g <- graph.adjacency( DIST < 0.5, mode="undirected" ) g <- simplify(g) no.clusters(g) assuming you have your distance matrix in 'DIST'. If N is too big then you

[R] R and Clusters

2008-01-07 Thread Lorenzo Isella
Dear All, I hope I am not asking a FAQ. I am dealing with a problem of graph theory [connected components in a non-directed graph] and I do not want to rediscover the wheel. I saw a large number of R packages dealing for instance with the k-means method or hierarchical clustering for spatially dist