Hi,

Being a novice this is my first usage of R.

I am trying to use rpart for building a decision tree in R. And I have the
following dataframe 


Outlook Temp    Humidity        Windy   Class
Sunny   75      70      Yes     Play
Sunny   80      90      Yes     Don't Play
Sunny   85      85      No      Don't Play
Sunny   72      95      No      Don't Play
Sunny   69      70      No      Play
Overcast        72      90      Yes     Play
Overcast        83      78      No      Play
Overcast        64      65      Yes     Play
Overcast        81      75      No      Play

The first line indicating the header. When I use the formula,

"CART<-rpart(Class ~ Outlook + Temp + Humidity + Windy, data=dataframe)"

and trying to plot the values of CART using plot(CART), I get the following
error,

"Error in plot.rpart(CART) : fit is not a tree, just a root".

Am I missing something here? Any help would be greatly appreciated. Btw, the
dataframe was obtained by reading a csv which shouldn't be an issue. 

-Jagdeesh


-- 
View this message in context: 
http://r.789695.n4.nabble.com/Rpart-query-tp2991198p2991198.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help@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.

Reply via email to