Skip to content
Prev 19090 / 398500 Next

Tree package on R 1.4.1

On Tue, 23 Apr 2002 baba at muj.biglobe.ne.jp wrote:

            
You can use a classification tree or a regression tree, but not a
`classification and regression tree'.  Your usage below suggests you want
a regression tree.
Well, that *is* what you asked for!  You read x2 as a numeric variable in
scan.  ?tree will tell you how to specify a categorical variable (via a
factor).
Try  Ex6$x2 <- factor(Ex6$x2).


Note that the rpart package is the recommended way to perform tree-based
analyses in R, and that `CART' is a trademark of a commercial package.