[R] distance in the function kmeans

Martin Maechler maechler at stat.math.ethz.ch
Fri May 28 11:39:49 CEST 2004


>>>>> "n\" == n\ bouget <n>
>>>>>     on Fri, 28 May 2004 09:37:35 +0200 writes:

    n\> Hi, I want to know which distance is using in the
    n\> function kmeans and if we can change this distance.
    n\> Indeed, in the function pam, we can put a distance
    n\> matrix in parameter (by the line
    n\> "pam<-pam(dist(matrixdata),k=7)" ) but we can't do it in
    n\> the function kmeans, we have to put the matrix of data
    n\> directly ...  Thanks in advance, Nicolas BOUGET

It might be interesting to look at this from the pam()
perspective:
What exactly is pam() lacking that kmeans() does for you?

Christian, are you suggesting that pam() could do the job if

1) there was a dist(., method="a la kmeans") 
2) pam() allowed to be started by a user-specified set of
	 medoids instead of the "Kaufman-Rousseeuw-optimal" ones
?

Regards,
Martin Maechler




More information about the R-help mailing list