Re: [R] kmeans and incom,plete distance matrix concern

From: Christian Hennig <chrish_at_stats.ucl.ac.uk>
Date: Tue 08 Aug 2006 - 02:49:57 EST

> Thanks everyone for their help so far. I'm very appreciative of the fact that
> people have pointed out that I was heading in the wrong direction.
> I would be most grateful if someone could look over the following simple
> example for me and tell me if this is how to do it.
> I'm assuming by data matrix you mean the 'raw data' organised as a matrix
> Data (not euclidean distance) matrix
>> DF
> V1 V2 V3 V4
> 1 78 45 34 45
> 2 97 23 67 12
> 3 9 56 12 67
> 4 19 67 23 90
> 5 34 12 78 56
>
> and then
>> clusters.kmeans <-kmeans(DF, 2)

This should work. (But why don't you try instead of asking first?)

> if I want 2 clusters for example.
>
> Am I also right in thinking that I can say which 'centriods' I want the clustering to be done?

You can specify from which centroids the kmeans iteration should start, if you want to.

Christian

>


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue Aug 08 16:18:49 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 08 Aug 2006 - 18:19:13 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.