[R] tree class in R?

Martin Maechler maechler at stat.math.ethz.ch
Mon Dec 6 12:24:24 CET 2004

>>>>> "DFARRAR" == DFARRAR  <DFARRAR at vt.edu>
>>>>>     on Sun, 5 Dec 2004 22:09:02 -0500 writes:

    DFARRAR> I am trying to store a couple numbers for each
    DFARRAR> partition, in a subset of the partitions of my data
    DFARRAR> set.  Of course, one can accomplish this using a
    DFARRAR> binary tree.  (The first split is on
    DFARRAR> inclusion/exclusion of the first object, and so
    DFARRAR> on.)  I can probably simulate a tree using vectors.
    DFARRAR> (One vector gives the index of left child node,
    DFARRAR> another the index of the right child node.)
    DFARRAR> However, it seems like there must be a useful class
    DFARRAR> associated with the clustering or recursive
    DFARRAR> partitioning procedures, perhaps not out there for
    DFARRAR> everyone to see.  I poked around on the R page and
    DFARRAR> didn't see anything that clearly met my needs very
    DFARRAR> directly.

but maybe indirectly?

There's the "dendrogram" class in R, --> "?dendrogram", which
had been created with the aim to be a class that would allow
both regression/classification trees and hierarchical cluster
dendrograms to be represented.  It's not just for binary trees,
and definitely much nicer to use than a "vector simulation"

    DFARRAR>   I hope I would not have to learn
    DFARRAR> recursive partitioning in R to find what I need.

(well, it may be worth your time to learn something about rpart
 anyway; but you won't want to use it's representation of trees,
 I think)

Martin Maechler, ETH Zurich

More information about the R-help mailing list