ahc_plots.RdDraws various plots for Ascending Hierarchical Clustering results.
ahc_plots(ahc, distance = NULL, max.cl = 20, type = "dist")object of class hclust or agnes
A dissimilarity matrix or a dist object. Only used if type is "inert" or "loss". Default is NULL.
Integer. Maximum number of clusters taken into account in the plots.
Character string. If "dist" (default), the distance between agregated clustersis plotted. If "inert", it is the percentage of explained inertia (pseudo-R2). If "loss", it is the relative loss of explained inertia (pseudo-R2).
data(Taste)
disjonctif <- dichotom(Taste[,1:11])
distance <- dist(disjonctif)
cah <- stats::hclust(distance, method = "ward.D2")
ahc_plots(cah, max.cl = 15, type = "dist")
ahc_plots(cah, distance = distance, max.cl = 15, type = "inert")
ahc_plots(cah, distance = distance, max.cl = 15, type = "loss")