dendextend (version 1.6.0)

get_branches_heights: Get height attributes from a dendrogram

Description

Get height attributes of a dendrogram's branches

Usage

get_branches_heights(dend, sort = TRUE, decreasing = FALSE,
  include_leaves = FALSE, ...)

Arguments

dend

a dendrogram.

sort

logical. Should the heights be sorted?

decreasing

logical. Should the sort be increasing or decreasing? Not available for partial sorting.

include_leaves

logical (FALSE). Should the output include the leaves value (0's).

...

not used.

Value

a vector of the dendrogram's nodes heights (excluding leaves).

Examples

Run this code
# NOT RUN {
hc <- hclust(dist(USArrests[1:4,]), "ave")
dend <- as.dendrogram(hc)
get_branches_heights(dend)

# }
# NOT RUN {
dat1 <- iris[1:150,-5]
dat1 <- rbind(dat1,dat1,dat1,dat1,dat1,dat1,dat1)
dend = as.dendrogram(hclust(dist(dat1)))
library(microbenchmark)
library(dendextendRcpp)
microbenchmark(
   dendextendRcpp::dendextendRcpp_get_branches_heights(dend),
   old_get_branches_heights(dend,sort=F)
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab