How to create a dendrogram with colored branches?
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 6 years ago . I would like to create a dendrogram in R which has colored branches, like the one shown below. So far I used following commands to create a standard dendrogram: d <- dist(as.matrix(data[,29])) # find distance matrix hc <- hclust(d) # apply hirarchical clustering plot(hc,labels=data[,1], main="", xlab="") # plot the dendrogram How should I modify this code to obtain desired