How to line (cut) a dendrogram at the best K
问题 How do I draw a line in a dendrogram that corresponds the best K for a given criteria? Like this: Lets suppose that this is my dendrogram, and the best K is 4. data("mtcars") myDend <- as.dendrogram(hclust(dist(mtcars))) plot(myDend) I know that abline function is able to draw lines in graphs similarly to the one showed above. However, I don't know how could I calculate the height, so the function is used as abline(h = myHeight) 回答1: The information that you need to get the heights came with