Hello, 

I use asRules from the Rattle package to make rules of a rpart decision tree: 
asRules(rpart1). It gives a rule such as (don't mind the data, it's merely 
testdata): 


 Rule number: 18 [Product=153 cover=3 (1%) prob=0.00]
   TotalChildren>=4.5
   Education=Bachelors,Partial College,Partial High School
   Gender=F
   Occupation=Skilled Manual


Then I want to save it so I use: rules <-asRules(rpart1) but it saves it as an 
integer. When I view "rules" I only see one column of integers. Not the data 
like the example above. Preferably I would like to have that data in a 
dataframe. 

The reproducible example can be found here: 

www.mediafire.com/download/8qqzq3qqu2mlmb1/decision+tree+rules+example.RData

The rpart tree is made with this: rpart1 <- rpart(Product ~ ., data=subset5, 
method="class", control=rpart.control(minbucket=2,minsplit=1, cp=-1))

Hope someone can help me out. Thanks!                                     
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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