# NOT RUN {
# simulate data from three different groups
d1 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE)
d2 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE)
d3 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE)
dd <- cbind(d1, d2, d3)
cutKmeans(dd, k=3)
cutKmeans(dd, k=4)
cutHclust(dd, k=3)
cutHclust(dd, k=4)
cutPam(dd, k=3)
cutPam(dd, k=4)
cutRepeatedKmeans(dd, k=3, nTimes=10)
cutRepeatedKmeans(dd, k=4, nTimes=10)
# cleanup
rm(d1, d2, d3, dd)
# }
Run the code above in your browser using DataLab