## Not run:
#
# dend = as.dendrogram(hclust(dist(iris[1:150,-5])))
#
# # plutral heightS
# dendextendRcpp_heights_per_k.dendrogram(dend,1)
# dendextendRcpp_heights_per_k.dendrogram(dend,.5)
# dendextendRcpp_heights_per_k.dendrogram(dend,0.05)
# dendextendRcpp_heights_per_k.dendrogram(dend,0)
# dendextendRcpp_heights_per_k.dendrogram(dend,-1)
#
# dendextendRcpp_heights_per_k.dendrogram(dend,c(1,.5,.2,0,-1))
#
# \dontrun{
# require(microbenchmark)
# dend = as.dendrogram(hclust(dist(iris[1:150,-5])))
# dend = as.dendrogram(hclust(dist(iris[1:30,-5])))
# dend = as.dendrogram(hclust(dist(iris[1:3,-5])))
# microbenchmark(
# # dendextendRcpp::heights_per_k.dendrogram(dend),
# dendextendRcpp::dendextendRcpp_heights_per_k.dendrogram(dend),
# dendextend::old_heights_per_k.dendrogram(dend)
# )
# # improvment is 10 times faster (in Rcpp) for a tree of size 3
# # 76 times faster for a tree of size 30
# # And:
# # 134 times faster for a tree of size 150!!
# }
# ## End(Not run)
Run the code above in your browser using DataLab