Syntactic Question in R

Hi there,

Would appreciate the help of someone expertise regarding the specific use of the argument (obj) from the 'evtree' package. Unfortunately, the package doesn't define it in context. Yet would be good to hear some opinions/feedback.

Basically, the 'evtree' measures accuracy by misclassification ('mc'), but this is set equal to the following argument:

mc <- function(obj) 1 - mean(predict(obj) == Data$X)

Again, unfortunately, the author's do not define 'obj', but would be good to know what it means in this context. Reference is Grubinger et al (2014) page 15. https://cran.r-project.org/web/packages/evtree/vignettes/evtree.pdf

Educated guess would be an evtree model object.

Hi @nirgrahamuk .

I appreciate you feedback there. But beyond the tautological point made, I still don't know what the 'object' is in the context of the model, since it's previously unmentioned in their script.

Could you expand any further?

https://www.tutorialspoint.com/r/r_functions.htm

This is a mere function definition. So there is no particular obj, nothing concrete.

However the function can be passed an object. Internal to the function scope it will have the name obj. The function operates on it and return a result. I attach a link here so you can read about functions. Hope that helps.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.