Draws various plots for Ascending Hierarchical Clustering results.

ahc_plots(ahc, distance = NULL, max.cl = 20, type = "dist")

Arguments

ahc

object of class hclust or agnes

distance

A dissimilarity matrix or a dist object. Only used if type is "inert" or "loss". Default is NULL.

max.cl

Integer. Maximum number of clusters taken into account in the plots.

type

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).

Author

Nicolas Robette

Examples

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")