On Fri, 28 May 2004, Uwe Ligges wrote: > n.bouget wrote: > > > Hi, > > I want to know which distance is using in the function kmeans > > and if we can change this distance. > > Indeed, in the function pam, we can put a distance matrix in > > parameter (by the line "pam<-pam(dist(matrixdata),k=7)" ) but > > we can't do it in the function kmeans, we have to put the > > matrix of data directly ... > > Thanks in advance, > > Nicolas BOUGET > > As the name says, kmeans() calculates *means* (centres) of clusters. It > does not any make sense to do that on distances ... > > Uwe Ligges
That's not really true. There is an equivalent to the k-means target criterion in terms of distances, and that uses squared Euklidean distances. However, as far as I know, you cannot compute it directly in R for any other distance. Using pam is the thing which comes closest. Christian Hennig *********************************************************************** Christian Hennig Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg [EMAIL PROTECTED], http://www.math.uni-hamburg.de/home/hennig/ ####################################################################### ich empfehle www.boag-online.de ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html