I am using the hardhat package to write a package that performs modeling for time to event outcomes. We use survival::Surv() to construct the outcome. The hardhat documentation was great for helping get a "formula" method working, e.g. foo(Surv(time, status) ~ var1 + var2).
The hardhat documentation also walks through how to include a recipes method, so users can construct the models this way. But I am getting an error. What is the best way to integrate a modeling package with time to event outcomes into a tidymodels framework?
Thank you!
library(survival)
recipes::recipe(Surv(time, status) ~ age, data = lung)
#> Error: No in-line functions should be used here; use steps to define baking actions.
I watched Max Kuhn's presentation on the package yesterday at the R in Pharma Conference. The examples he went through, and those on the website, don't use recipes to construct the models. Rather they use classes of models with supported engines to build those models. Is that the recommended approach? I haven't seen any tutorials on writing an engine in this manner...