dendrogram branches with different lty

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

dendrogram branches with different lty

Patrick Kuss

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


--
Patrick Kuss
PhD-student
Institute of Botany
University of Basel
Schönbeinstr. 6
CH-4056 Basel
+41 61 267 2976

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: dendrogram branches with different lty

Romain François
Hi Patrick,

You may want to try out my (highly experimental, so not on CRAN) package
A2R.
http://addictedtor.free.fr/packages/A2R/A2R_0.0-3.tar.gz
2 dendro's are displayed on RGG, check
http://addictedtor.free.fr/graphiques/search.php?q=dendrogram

You might also be interrested in Appendix B of Paul Murrel's book :
http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html

Romain

Le 16.12.2005 17:40, Patrick Kuss a écrit :

>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))
>
>
>--
>Patrick Kuss
>PhD-student
>Institute of Botany
>University of Basel
>Schönbeinstr. 6
>CH-4056 Basel
>+41 61 267 2976
>
--
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: dendrogram branches with different lty

Dr. Herwig Meschke
In reply to this post by Patrick Kuss
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 [hidden email]

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