Skip to content

how to construct tree under R

3 messages · ANA KOZOMARA, Marc Feldesman, Ko-Kang Kevin Wang

#
Hello.
I have a hudge problem, don't know how to deal with it...
I'm supposed to implement a tree structure in R, without using
rpart library...
I don't have any clue about appropriate approach...
Anyway, I can't use pointers under R...so how to to it?
lists, vectors...
Anyway, does anybody knows how the regression tree in rpart was
implemented...
Someone please help!
Thanks,
ana
#
On Sat, 17 May 2003 19:19:49 +0200, an incredible array of electrons
randomly cascading around the Universe collided and turned into words
spewed forth by ANA KOZOMARA:


ANA> Hello.
ANA> I have a hudge problem, don't know how to deal with it...
ANA> I'm supposed to implement a tree structure in R, without using
ANA> rpart library...
ANA> I don't have any clue about appropriate approach...
ANA> Anyway, I can't use pointers under R...so how to to it?
ANA> lists, vectors...
ANA> Anyway, does anybody knows how the regression tree in rpart was
ANA> implemented...
ANA> Someone please help!


You might look at the source code, which is available with the
library.  You could also look at the technical report available on
CRAN (package sources), which explains the way the program works.  If
all else fails, you could also look at Breiman et al, "Classification
and Regression Trees" which is the canonical source for this.

HTH
#
Hi,
On Sat, 17 May 2003, ANA KOZOMARA wrote:

            
I'm not sure what exactly you want here.  If you want to write a function 
that uses some kind of algorithms on decision trees (e.g. CART) then you 
will have to consult some technical books.

If you are just working on a practical problem, i.e. you have got a data 
set and just want to get a tree from it, then the tree or rpart package 
are two of the packages you can use (and you can consult "Modern Applied 
Statistics with S" by Venables and Ripley, 2002).  I am not sure why you 
do not want to use the rpart package, but the tree package has some very 
good documentation which you can read and find out how to use it.