Skip to main content

dendrogram_links

Function dendrogram_links 

Source
pub fn dendrogram_links(
    merge: &[(i64, i64)],
    heights: &[f64],
    labels: &[&str],
) -> Vec<(String, Vec<Value>)>
Expand description

Parent → child links for a dendrogram from an R hclust-style merge matrix: row k merges a and b (negative = leaf -a, 1-based; positive = the cluster formed at row a) at heights[k]. Returns columns from, to and height (the parent’s merge height) ready for geom_dendrogram; leaves are named by labels (1-based leaf i → labels[i - 1]), clusters "#k".