Re: [R] dendrogram branches with different lty

From: Dr. Herwig Meschke <HerwigMeschke_at_t-online.de>
Date: Mon 19 Dec 2005 - 00:27:49 EST


On 16 Dec 2005 at 17:40, Patrick Kuss wrote:

>
> Dear r-list,
>
> I am trying to visually seperate the two main clusters of a dendrogram.
> The idea is to use:
>
> 'edgePar=list(lty=3)' for 'dend1[[1]]' and
> 'edgePar=list(lty=1)' for 'dend1[[2]]'
>
> I have not found a way to solve this. Any suggestions?
>
> Patrick
>
> hc <- hclust(dist(USArrests), "ave")
> (dend1 <- as.dendrogram(hc))
> par(mfrow=c(2,2))
> plot(dend1)
> plot(dend1[[1]],edgePar=list(lty=3))
> plot(dend1[[2]],edgePar=list(lty=1))

try
dend1[[1]] <- dendrapply(dend1[[1]], function(e) { attr(e, "edgePar") <- list(lty=3); e }) plot(dend1)

Regards,
Herwig

-- 
Dr. Herwig Meschke
Wissenschaftliche Beratung
Hagsbucher Weg 27
D-89150 Laichingen

phone +49 7333 210 417 / fax +49 7333 210 418
email HerwigMeschke@t-online.de

______________________________________________
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 Mon Dec 19 00:41:24 2005

This archive was generated by hypermail 2.1.8 : Mon 19 Dec 2005 - 04:27:45 EST