Re: [R] how to draw the data set processed by hclust?

From: Ale? ?iberna <ales.ziberna_at_guest.arnes.si>
Date: Tue 15 Mar 2005 - 01:38:14 EST

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)!

> 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@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
>
>



R-help@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 Received on Tue Mar 15 01:43:53 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:47 EST