data("Votes")
### create dummy coding (with removed party affiliation)
x <- as.dummy(Votes[-17])
### calculate distance matrix
d <- dists(x, method = "binary")
### plot dissimilarity matrix unseriated
res <- cluproxplot(d, method = "No seriation", main = "No seriation")
### plot matrix seriated
res <- cluproxplot(d, main = "Seriation - (Murtagh, 1985)")
### cluster with pam
library("cluster")
l <- pam(d, 8, cluster.only = TRUE)
res <- cluproxplot(d, l, main = "PAM + Seriation (Murtagh)")
res <- cluproxplot(d, l, method = c("Optimal", "Optimal"),
main = "PAM + Seriation (Optimal Leaf ordering)")
### the result
names(res)
res$descriptionRun the code above in your browser using DataLab