[R] Colouring hclust() trees

Thomas Petzoldt petzoldt at rcs.urz.tu-dresden.de
Mon May 10 20:49:32 CEST 2004


Richard A. O'Keefe wrote:
> I have a data set with  6 variables and 251 cases.
> The people who supplied me with this data set believe that it falls
> naturally into three groups, and have given me a rule for determining
> group number from these 6 variables.

One possibility is to extract the coordinates used by the dendrogram 
using par("usr") and then to do annotations using ?text, but as a global 
alternative in cases like this (many cases and known number of classes), 
I would suggest a different cluster alorithm, e.g. ?kmeans. If you want 
to get a visual idea you may try to apply an ordination method (e.g. 
princomp or isoMDS the latter from package MASS) and color the objects 
according to their class found by kmeans.

Hope it helps

Thomas P.




More information about the R-help mailing list