I'm using rpart
to fit a regression model using monthly weather data. I would like partitioning to be done in order: first Jan, then Feb and so on. Is there a way to set the order of the variables?
adding an example: I want the nodes of the tree to be in order.
set.seed(1)
jan<-sample(size=30,1:150)
feb<-sample(size=30,1:200)
mar<-sample(size=30,1:150)
yield<-sample(size=30,0.5:3.5,replace = TRUE)
model<-rpart(yield~jan+feb+mar,method = "anova", minsplit=3, minbucket=1)
rpart.plot(model)