[R] Clustering and Calinski's index

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Feb 20 17:06:10 CET 2002


On Wed, 20 Feb 2002, David Wartel wrote:

>
> I have to solve a clustering problem.
> My first step is to determinate the number of clusters, that's why I 'm using
> the Calinski index ( [tr(b)/(k-1)]/[tr(w)/(k-1)] )  which i try to maximize
> to have the best number of clusters.
> A function is already implemented in R to calculate this index :
>
> clustIndex(cl,x, index="calinski")

Where is that from? It's not part of R -- package cclust, perhaps?

> where cl is the result of a clustering method , for instance:
>
> cclust(x,k,itermax,verbose=TRUE,method="kmeans")
>
> My probleme is that I can't calculate the Calinski's index when a cluster
> contains only one datapoint :
>
> Error in cov(x[cluster == l, ]) : supply both x and y or a matrix-like x

The programmer forgot drop=FALSE, it would seem.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list