[R] cluster analysis in R

KitKat katherinewright at trentu.ca
Thu Nov 22 19:32:16 CET 2012


These are the errors I've been having. I have been trying 3 different things

1- Mclust:
This is the example I have been following:
# Model Based Clustering
library(mclust)
fit <- Mclust(mydata)
plot(fit, mydata) # plot results 
print(fit) # display the best model 
 
What I have done:
> fit <- Mclust(mydat)
> plot(fit, mydat) #plot results
Error in match.arg(what, c("BIC", "classification", "uncertainty",
"density"),  : 
  'arg' must be NULL or a character vector

2- Mclust using different website (cran-r) instructions
This is the example: 
> mydatMclust <- Mclust(mydat)
> summary(mydatMclust)
> summary(mydatMclust, parameters = TRUE)
> plot(mydatMclust)

There are a couple other steps but the plot is the problem. I get two plots,
there should be four. One should be plotting all my individuals but it's
plotting my variables instead. It's also taking a very long time. R script
at this point says: "Waiting to confirm page change… "

3. Mcclust 
Instructions from cran-r:
data(cls.draw2)
# sample of 500 clusterings from a Bayesian cluster model
tru.class <- rep(1:8,each=50)
# the true grouping of the observations
psm2 <- comp.psm(cls.draw2)
# posterior similarity matrix
# optimize criteria based on PSM
mbind2 <- minbinder(psm2)
mpear2 <- maxpear(psm2)
# Relabelling
k <- apply(cls.draw2,1, function(cl) length(table(cl)))
max.k <- as.numeric(names(table(k))[which.max(table(k))])
relab2 <- relabel(cls.draw2[k==max.k,])
# compare clusterings found by different methods with true grouping
arandi(mpear2$cl, tru.class)
arandi(mbind2$cl, tru.class)
arandi(relab2$cl, tru.class)

I called my data: mydat so I changed that where appropriate. I cannot get
past one early step, psm2 <- comp.psm(cls.draw2).. the error reads: "Error:
could not find function "comp.psm""

I think I have all appropriate packages installed. I don't know what more to
do on these three errors.  Any help would be great! Thank you




--
View this message in context: http://r.789695.n4.nabble.com/cluster-analysis-in-R-tp4649635p4650466.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list