[R] tree()

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Feb 20 11:09:59 CET 2007


This is a function of your data and the tuning parameters you chose to 
use.  See ?tree.control.

On Tue, 20 Feb 2007, stephenc wrote:

> Hi
>
> I am trying to use tree() to classify movements in a futures contract.  My
> data is like this:
>
>         diff      dip                  dim             adx
> 1          0    100.00000    8650.0000    100.00000
> 2          0     93.18540    2044.5455     93.18540
> 3          0     90.30995    1549.1169     90.30995
> 4          1     85.22030     927.0419     85.22030
> 5          1     85.36084     785.6480     85.36084
> 6          0     85.72627     663.3814     85.72627
> 7          0     78.06721     500.1113     78.06721
> 8          1     69.59398     376.7558     69.59398
> 9          1     71.15429     307.4533     71.15429
> 10         1     71.81023     280.6238     71.81023
>
> plus another 6000 lines
>
> The cpus example works fine and I am trying this:
>
> tree.model <- tree(as.factor(indi$diff) ~ indi$dim + indi$dip + indi$adx,
> indi[1:4000,])

Oh, please!  use the data= argument properly.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list