October 2017
Beginner to intermediate
572 pages
26h 1m
English
Besides drawing rectangles around all hierarchical clusters, you can place a red rectangle around a certain cluster:
> rect.hclust(hc, k = 4 , which =2, border="red")

Also, you can color clusters in different colors with a red rectangle around the clusters by using the dendextend package. You have to complete the instructions outlined in the There's more... section of the previous recipe and perform the following steps:
> dend %>% color_branches(k=4) %>% plot(horiz=TRUE, main = "Horizontal Dendrogram")
Read now
Unlock full access