# NOT RUN {
hc <- hclust(dist(USArrests), "ave")
# return groups, leaves ordered by dendrogram
slice(hc,k=5)
# return groups, leaves ordered as originally passed to hclust
slice(hc,k=5)[order(hc$order)]
# }
Run the code above in your browser using DataLab