On 26 Apr 2014, at 02:35, chris Jhon <cjhon...@gmail.com> wrote:

> The question is how to plot the cluster number on the dendrogram plot?

Besides Peter Langfelder’s suggestion, you may also want to take a look at CRAN 
packages dendroextras or dendextend

For example using the dendro    extras

# set up your data
##
y=read.table(text=" V1 V2 V3 V4
A  1  2  3  4
B  5  6  7  8
C  9 10 11 12
D 13 14 15 16
E 17 18 19 20",header=T)
clu<-hclust(dist(y),method="complete")
plot(clu)

# plot dendrogram coloured by cluster:
##
library(dendroextras)
cluc=colour_clusters(clu, k=3, labels=TRUE)
plot(cluc)

Best wishes,

Greg Jefferis.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to