Learn R Programming

dendextend (version 1.18.1)

rank_order.dendrogram: Fix rank of leaves order values in a dendrogram

Description

Generally, leaves order value should be a sequence of integer values. From 1 to nleaves(dend). This function fixes trees by using rank on existing leaves order values.

Usage

rank_order.dendrogram(dend, ...)

Value

A dendrogram, after fixing its leaves order values.

Arguments

dend

a dendrogram object

...

not used

See Also

prune

Examples

Run this code

# define dendrogram object to play with:
dend <- USArrests[1:4, ] %>%
  dist() %>%
  hclust(method = "ave") %>%
  as.dendrogram()
# plot(dend)
order.dendrogram(dend)
dend2 <- prune(dend, "Alaska")
order.dendrogram(dend2)
order.dendrogram(rank_order.dendrogram(dend2))

Run the code above in your browser using DataLab