Re: [R] rpart error when constructing a classification tree

From: Uwe Ligges <ligges_at_statistik.tu-dortmund.de>
Date: Wed, 30 Jan 2008 10:33:14 +0100

Randy Griffiths wrote:
> I am trying to make a decision tree using rpart. The function runs very
> quickly considering the size of the data (1742, 163). When I call the
> summary command I get this:
>

>> summary(bookings.cart)

> Call:
> rpart(formula = totalRev ~ ., data = bookings, method = "class")
> n=1741 (1 observation deleted due to missingness)
>
> CP nsplit rel error
> 1 0 0 1
> Error in yval[, 1] : incorrect number of dimensions
>

And we get:

R> summary(bookings.cart)
Error in summary(bookings.cart) : object "bookings.cart" not found

hence we cannot reproduce and inspect your problem. Please read the posting guide.

Uwe Ligges

> note:

>> dim(bookings)

> [1] 1742 163
>
>
> I have run rpart on past projects without any problems. I have used a
> catagorical version of the variable totalRev that was partitioned into four
> levels (and coded as a factor).
> I tried making a tree with the tree command (in the 'tree' package) and was
> able to construct a tree without any errors. However, I would much rather
> use rpart.
>
> Does anyone have any ideas that might help?
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 30 Jan 2008 - 09:44:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 04 Feb 2008 - 17:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive