Skip to content
Back to formatted view

Raw Message

Message-ID: <1323151094047-4163621.post@n4.nabble.com>
Date: 2011-12-06T05:58:14Z
From: elisacarli21
Subject: Problem with clusplot

Dear all
I'm trying to run a cluster analysis with R
Here are the commands:

mydata <- na.omit(matrix) # listwise deletion of missing
mydata <- scale(matrix) # standardize variables 

 fit <- kmeans(mydata, 8) # 8 cluster solution
 # get cluster means 
aggregate(mydata,by=list(fit$cluster),FUN=mean)
 # append cluster assignment
 mydata <- data.frame(mydata, fit$cluster) 

 library(cluster) 
clusplot(mydata, fit$cluster, color=TRUE, shade=TRUE,  labels=2, lines=0)


I get the following error
Error in princomp.default(x, scores = TRUE, cor = ncol(x) != 2) : 
  'princomp' can only be used with more units than variables

How can I fix it?

Thanks

--
View this message in context: http://r.789695.n4.nabble.com/Problem-with-clusplot-tp4163621p4163621.html
Sent from the R help mailing list archive at Nabble.com.