Skip to content
Prev 65861 / 398513 Next

how to draw the data set processed by hclust?

type
 ?hclust
for how to use hclut, for example
 hc <- hclust(dist(USArrests), "ave")
Notice that you have to first compute the distance matrix with function 
"dist" or simmilar.

to get groups see
?cutree
for expamle for three grouops use k=3
groups<-cutree(hc,k=3)
and then plot using
plot(USArrests,col=groups)

I hope this help! In the future, PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html and follow the instructions 
(read help pages)!



----- Original Message ----- 
From: "XP Sun" <xpsun at ict.ac.cn>
To: <r-help at stat.math.ethz.ch>
Sent: Sunday, March 13, 2005 1:23 PM
Subject: [R] how to draw the data set processed by hclust?