[R] Customizing Cluster Analysis plots created with hclust

Martin Maechler maechler at stat.math.ethz.ch
Thu Jul 1 16:22:34 CEST 2004

>>>>> "TomJ" == Joy, Tom <Tom.Joy at rmbinternational.com>
>>>>>     on Thu, 1 Jul 2004 11:20:33 +0100 writes:

    TomJ> I am trying to cluster stock prices through time using
    TomJ> hclust.  To help with the interpretation of the output
    TomJ> I would like to change the colour of the lines and the
    TomJ> labels based on which sector a stock is in.  Is it
    TomJ> possible to customize a plot of the output of hclust
    TomJ> in this way?

It will be possible in the next versoin of R,
and soon in "R-devel" --

 myhcl <- hclust(..........)
 myd <- as.dendrogram(myhcl)

i.e. working with the dendrogram (and its plot method) rather
than with the original "hclust" object and its much less
flexible plotting method.

Since the needed changes only need R-code changes, you
can ask me "off line" and I'll send you the R code needed.


More information about the R-help mailing list