[R] distance in the function kmeans

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri May 28 10:12:43 CEST 2004


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


> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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




More information about the R-help mailing list