[R] how to draw the data set processed by hclust?
Ale? ?iberna
ales.ziberna at guest.arnes.si
Mon Mar 14 15:38:14 CET 2005
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?
> hi, all
>
> i hava a dataset formated as follow:
>
> x1 y1 z1
> x2 y2 z2
> x3 y3 z3
> ...
>
> how to cluster it with hclust?
> and the draw the data with color of cluster?
>
> thank you in advance!
>
> best!
> xpsun
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
More information about the R-help
mailing list