Sir, Would like to know what sort of input matrix are taken by the kmeans function defined in mva library of R application. As per the documentation for the Kmeans it takes the following 2 data sets: 1) data 2) centers The commands to be executed in R are as follows: library(mva) data <- read.table('file1',header=TRUE,sep="\t") centers <- read.table('file2',header=TRUE,sep="\t") sink("output") kmeans(data,centers,maxiters) Can you please help me in providing with the data and center values. The data I am currrently using gives me an error -- empty cluster: try better set of initial centers. Number of clusters centers mush lie between 1 and nrow(n). Waiting for your reply regards shalabh ____________________________________________________________________ Get free email and a permanent address at http://www.netaddress.com/?N=1 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, Sep 14, 2000 at 12:58:52AM -0600, Shalabh Gandhi wrote:> Can you please help me in providing with the data and center values. The data > I am currrently using gives me an error -- empty cluster: try better set of > initial centers. Number of clusters centers mush lie between 1 and nrow(n).xx <- cbind(c(rnorm(100,0),rnorm(100,4)) , c(rnorm(100,9),rnorm(100,2)) ) kmeans(xx , cbind(c(4,0), c(9,2)) ) but:> kmeans(xx , cbind(c(4,0,32,43), c(9,2,23,43)) )Error in switch(Z$ifault, stop("empty cluster: try a better set of initial centers"), : empty cluster: try a better set of initial centers ... -- P.Malewski, Maschplatz 8, 38114 Braunschweig, Tel.: 0531 500965, MH-Hannover: 0511 532 3194 / Fax: 0511 532 3190, P.Malewski at tu-bs.de, peter.malewski at gmx.de, malewski.peter at mh-hannover.de. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._