Hi all, I am wandering.. is it possible to cluster data which is in a single column ? for example.. I have some data as follows: 4013 7362 7585 9304 11879 14785 21795 30500 30669 30924 33988 36975 40422 42911 50501 51593 53729 54338 55497 57337 61993 62601 66229 69815 69933 70760 71340 75921 83972 90134 91061 . . . is it possible to cluster this data since it is in a single column ? I have used the following R commands: data <- read.table("cluster.txt") dataMatrix <- t(data) I then tried to cluster using the following: xcl <-cclust(dataMatrix,2,20,verbose=TRUE,method="kmeans") when I run this i receive the following error message: Error in x[rank(runif(xrows))[1:ncenters], ] : incorrect number of dimensions I would be grateful for any pointers in the right direction Thanks for your help Saurabh [[alternative HTML version deleted]]
Johri, Saurabh wrote:> Hi all, > > I am wandering.. is it possible to cluster data which is in a single > column ? > for example.. I have some data as follows: > > 4013 > 7362 > 7585 > 9304 > 11879 > 14785 > 21795 > 30500 > 30669 > 30924 > 33988 > 36975 > 40422 > 42911 > 50501 > 51593 > 53729 > 54338 > 55497 > 57337 > 61993 > 62601 > 66229 > 69815 > 69933 > 70760 > 71340 > 75921 > 83972 > 90134 > 91061 > . > . > . > > is it possible to cluster this data since it is in a single column ? > > I have used the following R commands: > > data <- read.table("cluster.txt") > dataMatrix <- t(data) > > I then tried to cluster using the following: > > xcl <-cclust(dataMatrix,2,20,verbose=TRUE,method="kmeans") > > when I run this i receive the following error message: > > Error in x[rank(runif(xrows))[1:ncenters], ] : > incorrect number of dimensions > > I would be grateful for any pointers in the right direction > > Thanks for your help > > Saurabh > > >cclust() does not work for one-dim. data. I'd use kmeans() in package "stats" ... Uwe Ligges> > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! R-project.org/posting-guide.html
Possibly Parallel Threads
- minimisation problem, two setups (nonlinear with equality constraints/linear programming with mixed constraints)
- Problem with dyn.load...or else...
- Unregistred users can pass calls, peer being static
- [Bug 11646] New: rsync incapable of copying corrupted filesystem
- Problem with correct usage of formula environment