Closed LukasTang closed 1 year ago
modelr is now superseded, which means that we'll only perform critical bug fixes needed to keep it on CRAN. Thanks for contributing this idea and my apologies that it took so long to inform you that this package is no longer under development.
Hi,
I have custom model objects, that I define, for example, as follows:
setClass("custommodel",slots=list(coef="numeric"))
setMethod("predict", "custommodel",function(object,newdata){ newdata$pred<-object@coef return(list(fit=newdata$pred))})
model<-new("custommodel",coef=3)
But then I cannot apply:
df%>%add_predictions(model)
Because it says "no applicable method predict for object pf class custommodel"
I believe that the namespace for predict is defined to be from the stats package, could it be possible to make the function more flexible? Or is it already possible?
Reproducible example: