Description Usage Arguments Value Author(s) See Also Examples
Get branches height attributes from a dendrogram.
This function is intended to override get_branches_heights
.
Since it is 40-100 times faster.
1 2 | dendextendRcpp_get_branches_heights(tree, sort = TRUE, decreasing = FALSE,
...)
|
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. |
A numeric vector of the dendrogram's nodes heights (excluding leaves).
Tal Galili
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.