[R] kmeans and incom,plete distance matrix concern

Gabor Grothendieck ggrothendieck at gmail.com
Mon Aug 7 17:58:50 CEST 2006

?kmeans says the following.  Note that x is a matrix of ***data***.
Also look at the examples at the end of the help page if its still
not clear.


     kmeans(x, centers, iter.max = 10, nstart = 1,
            algorithm = c("Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"))


       x: A numeric matrix of data, or an object that can be coerced to
          such a matrix (such as a numeric vector or a data frame with
          all numeric columns).

On 8/7/06, Ffenics <ffenics2002 at yahoo.co.uk> wrote:
>         Thanks. I had a look at that and it says:
> Partitioning Clustering:
>                Function                            kmeans()                          from package stats provides   several algorithms   for computing partitions with respect to   Euclidean distance.
> Hence why I am using a euclidean distance matrix. Why is this incorrect?
> Gabor Grothendieck <ggrothendieck at gmail.com> wrote:
> There are many clustering functions in R and R packages and some
> take distance objects whereas others do not.  You likely read about
> hclust or some different clustering function.  See ?kmeans for the
> kmeans function and also look at the CRAN Task View on clustering for
> other clustering functions:
>  http://cran.r-project.org/src/contrib/Views/
>        [[alternative HTML version deleted]]
> ______________________________________________
> R-help at 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.

More information about the R-help mailing list