Dear R community,

 

I am trying to write my own user defined split function for rpart. I read
the example in the tests directory and I understand the general idea of the
how to implement user defined splitting functions. However, I am having
troubles with addressing the data frame used in calling rpart in my split
functions. 

For example, in the evaluation function that is called once per node, I want
to fit a proportional odds model to the data in the node and use its
deviance as node deviance:

 

evalf <- function(y,x,parms) {

       

pomnode<-polr(dataframe$y~dataframe$x,dataframe,weights=dataframe$Freq)

 

more code

}

 

The dataframe used in the polr call should be the data of the current node.
How can I address the data of the current node and assign it to the
dataframe?

 

 

Thank you for your help,

Tobias Guennel


        [[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch 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