Learn R Programming

guideR (version 0.4.0)

plot_inertia_from_tree: Plot inertia, absolute loss and relative loss from a classification tree

Description

Plot inertia, absolute loss and relative loss from a classification tree

Usage

plot_inertia_from_tree(tree, k_max = 15)

get_inertia_from_tree(tree, k_max = 15)

Value

A ggplot2 plot or a tibble.

Arguments

tree

A dendrogram, i.e. an stats::hclust object, an FactoMineR::HCPC object or an object that can be converted to an stats::hclust object with stats::as.hclust().

k_max

Maximum number of clusters to return / plot.

Examples

Run this code
hc <- hclust(dist(USArrests))
get_inertia_from_tree(hc)
plot_inertia_from_tree(hc)

Run the code above in your browser using DataLab