dendextendRcpp_get_branches_heights: Get branches height attr from a dendrogram

Description Usage Arguments Value Author(s) See Also Examples

Description

Get branches height attributes from a dendrogram.

This function is intended to override get_branches_heights. Since it is 40-100 times faster.

Usage

1
2

Arguments

tree

a dendrogram object.

sort

logical (TRUE). Should the heights be sorted?

decreasing

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

...

not used.

Value

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

Author(s)

Tal Galili

See Also

labels, dendrogram, attr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## Not run: 
dend = as.dendrogram(hclust(dist(iris[1:150,-5])))
plot(dend)
get_height(dend)


attributes(dend) <- NULL
Rcpp_get_dend_heights(dend) # knows to through a warning :)

dend = as.dendrogram(hclust(dist(iris[1:150,-5])))
Rcpp_get_dend_heights(dend)
get_branches_heights(dend)
Rcpp_get_dend_heights(dend,T,F)
Rcpp_get_dend_heights(dend,T,F)

# require(dendextend)
Rcpp_get_dend_heights(dend)
dendextendRcpp_get_branches_heights(dend,sort=F)

\dontrun{
require(microbenchmark)
microbenchmark(
   dendextendRcpp::dendextendRcpp_get_branches_heights(dend),
   old_get_branches_heights(dend,sort=F)
)
# Rcpp is about 40-107 times faster!
}

## End(Not run)

talgalili/dendextendRcpp documentation built on May 31, 2019, 2:53 a.m.