Convert a Basin Merge Tree to a Dendrogram
Source:R/basin_merge_tree_public.R
as.dendrogram.basin.merge.tree.RdConverts one connected component and one orientation of a canonical basin
merge tree to a crossing-free dendrogram. The conversion preserves the
exact branch hierarchy and deterministic leaf order. Its nonnegative
hclust heights are display coordinates measured from the most extreme
birth level; exact scalar-field merge levels remain attached as attributes.
Consequently, the returned dendrogram must not be interpreted as a tree
inferred from pairwise distances.
Usage
# S3 method for class 'basin.merge.tree'
as.dendrogram(
object,
direction = "max",
component = NULL,
label = c("basin.id", "extremum.id", "extremum.vertex"),
labels = NULL,
...
)Arguments
- object
A
basin.merge.tree, or a compatiblebasin_complex.- direction
Tree orientation,
"max"or"min".- component
Graph-component number. It may be omitted when the selected direction has exactly one graph component.
- label
Canonical basin-table field used for leaf labels.
- labels
Optional custom labels. A named vector is matched by basin id; an unnamed vector follows deterministic basin-table order.
- ...
Reserved for S3 compatibility.