Tree cut and Rectangles around clusters for a horizontal dendrogram in R
问题 I am trying to plot the results of a hierarchical clustering in R as a dendrogram, with rectangles identifying clusters. The following code does the trick for a vertical dendrogram, but for a horizontal dendrogram, ( horiz=TRUE ), the rectangles are not drawn. Is there any way to do the same for horizontal dendrograms too. library("cluster") dst <- daisy(iris, metric = c("gower"), stand = FALSE) hca <- hclust(dst, method = "average") plot(as.dendrogram(hca), horiz = FALSE) rect.hclust(hca, k