Petra Steiner
2003-Sep-26 22:06 UTC
[R] a. crossing branches with hclust, b. plot.dendrogram
Hello, a. when I use hclust with the methods media, centroid, and mcquitty, and plot the results, the dendrograms have lines that are crossing each other. Is this ok? b. My next question refers to plot.dendrogram: How can I use parameters as "hang" or "cex" here? E.g. for st <- as.dendrogram(subtreeshc[[x]]) I would like to have something like this, where cex and hang would work: plot(st, frame.plot=F, cex = 0.4, hang = 0, sub = "", xlab = "", ylab="", main = paste("Distance: ", me, " - Clustering Method: ", mecl, " - Subtree ", x, collapse="", sep="")) Thanks and best regards, Petra -- Petra Steiner International Computer Science Institute (ICSI) 1947 Center Street, Berkeley, CA, 94704-1198, USA http://www.ICSI.berkeley.edu/~petra
Martin Maechler
2003-Sep-29 07:24 UTC
[R] a. crossing branches with hclust, b. plot.dendrogram
>>>>> "Petra" == Petra Steiner <petra at icsi.berkeley.edu> >>>>> on Fri, 26 Sep 2003 15:06:59 -0700 writes:Petra> Hello, a. when I use hclust with the methods media, "median" Petra> centroid, and mcquitty, and plot the results, the Petra> dendrograms have lines that are crossing each Petra> other. Is this ok? yes. It is known in the litterature that only some methods (those that are `monotone') are guaranteed to produce dendrograms without "reversal"s or "inversion"s. I don't have the complete theory handy, but I know that "centroid" is known *not* to fulfill the property and "single", "complete" and "average" linkage *are*. Petra> b. My next question refers to plot.dendrogram: How Petra> can I use parameters as "hang" or "cex" here? Petra> E.g. for Petra> st <- as.dendrogram(subtreeshc[[x]]) The vertical position of nodes is part of the dendrogram definition, hence use st <- as.dendrogram(subtreeshc[[x]], hang = ...) Where as "cex" can be specified using `nodePar', see the examples on help(plot.dendrogram). Petra> I would like to have something like this, where cex Petra> and hang would work: Petra> plot(st, frame.plot=F, cex = 0.4, hang = 0, sub = "", Petra> xlab = "", ylab="", main = paste("Distance: ", me, " Petra> - Clustering Method: ", mecl, " - Subtree ", x, Petra> collapse="", sep="")) Petra> Thanks and best regards, Petra You're welcome. -- Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/ Seminar fuer Statistik, ETH-Zentrum LEO C16 Leonhardstr. 27 ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND phone: x-41-1-632-3408 fax: ...-1228 <><