Last chance! 50% off unlimited learning
Sale ends in
Duplicates a leaf in a tree. Useful for non-parametric bootstraping trees since it emulates what would have happened if the tree was constructed based on a row-sample with replacments from the original data matrix.
sample.dendrogram(dend, replace = FALSE, dend_labels, sampled_labels, fix_members = TRUE, fix_order = TRUE, fix_midpoint = TRUE, ...)
Only works when replace=TRUE!
## Not run:
# # define dendrogram object to play with:
# dend <- USArrests[1:5,] %>% dist %>% hclust(method = "ave") %>% as.dendrogram
# plot(dend)
#
# # # same tree, with different order of labels
# plot(sample.dendrogram(dend, replace = FALSE))
#
# # # A different tree (!), with some labels duplicated,
# # while others are pruned
# plot(sample.dendrogram(dend, replace = TRUE))
# ## End(Not run)
Run the code above in your browser using DataLab