-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential error on S3 dispatch #1090
Comments
Continuing the conversation from https://forum.posit.co/t/hardhat-vs-parsnip-to-create-new-models/183824 I had a look at your GitHub repo and I would suggest using the predict generic from stats, like parsnip does. I think that you defining your own generic here interferes with the S3 dispatch. I would export |
Thanks @hfrick . I did start without exporting I'm new to package building, trying to learn by doing...but I would appreciate if you could suggest some potential 'must-reads' to help me work with |
brulee is a great example for making a modelling package with hardhat. Keep in mind though that the brulee package does not contain the parsnip model or engine, you will find those in parsnip itself. If you are looking for more examples of extending parsnip, you could take a look at the repos for bonsai, censored, multilevelmod, plsmod, poissonreg, and rules which are all parsnip extention packages. They contain various engines for models in parnsip, i.e., the model definition itself is not in the extension package as it is for Since you already found Max's presentation on hardhat and the article on building a parsnip model, I think it's likely that you also already found the R packages book but I'll mention it for completeness. An additional resource specifically for extending parsnip are the checklists in this draft PR. Feedback on those is very welcome so if you run into things that are unclear, please ask! |
Thanks. My main goal is to be able to use By the way, I added #' @export to my package as you suggested and it worked !!! Thanks |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
The problem
I'm having trouble with building a working
parsnip
model. The modelfit
works fine but for some reason S3 is not able to properly find thepredict
function.See below a reproducible example. Any help is really appreciated.
Reproducible example
Created on 2024-03-25 with reprex v2.1.0
Session info
The text was updated successfully, but these errors were encountered: