# define dendrogram object to play with:
dend <- as.dendrogram(hclust(dist(USArrests[1:5,]), "ave"))
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))Run the code above in your browser using DataLab