data(cups)
# amalgamation clustering (weighted parts)
cups.aclust <- ACLUST(cups)
plot(cups.aclust)
# reproducing Figure 2(b) of Greenacre (2019) (unweighted parts))
# dataset Aar is in the compositions package
# aar is a subset of Aar
# code given here within the '\dontrun' environment since external package 'compositions' required
if (FALSE) {
library(compositions)
data(Aar)
aar <- Aar[,c(3:12)]
aar.aclust <- ACLUST(aar, weight=FALSE)
# the maximum height is the total variance
# convert to percents of variance NOT explained
aar.aclust$height <- 100 * aar.aclust$height / max(aar.aclust$height)
plot(aar.aclust, main="Parts of Unexplained Variance", ylab="Variance (percent)")
}
Run the code above in your browser using DataLab