Re: [R] Help with hclust() and plot()

About this list Date view Thread view Subject view Author view Attachment view

From: Sundar Dorai-Raj (sundar.dorai-raj@pdf.com)
Date: Fri 21 May 2004 - 01:49:25 EST


Message-id: <40ACD385.6010803@pdf.com>


michael watson (IAH-C) wrote:
> Hi
>
> When I use plot(hclust(dist..)...)...) etc to create a dendrogram of a
> hierarchial cluster analysis, I end up with a vertical tree. What do I
> need to do to get a horizontal tree?
>
> Also, my users are used to seeing trees who's leaves all "end" at the
> same place (eg. Like in minitab). Is this possible in R?
>
> Thanks
>
> Mick
>

Mick,
   If you use as.dendrogram first then the plot method for dendrograms
has a horizontal option:

data(USArrests)
hc <- hclust(dist(USArrests), "ave")
dend1 <- as.dendrogram(hc)
plot(dend1, horiz = TRUE)

This also puts the leave at the end.

R version 1.9.0, 2004-05-06
Windows 2000

--sundar

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:11 EST