x <- 1:3 %>%
dist() %>%
hclust() %>%
as.dendrogram()
plot(x)
partition_leaves(x)
if (FALSE) {
set.seed(23235)
ss <- sample(1:150, 10)
dend1 <- iris[ss, -5] %>%
dist() %>%
hclust("com") %>%
as.dendrogram()
dend2 <- iris[ss, -5] %>%
dist() %>%
hclust("single") %>%
as.dendrogram()
partition_leaves(dend1)
partition_leaves(dend2)
}
Run the code above in your browser using DataLab