coxsnell_flexsurvreg fails when the formula contains a transformation.
fitg <- flexsurvreg(formula = Surv(futime, fustat) ~ factor(ecog.ps), data = ovarian, dist = "gengamma")
coxsnell_flexsurvreg(fitg)
Users can work around this by transforming their data before calling flexsurvreg. However it would be nice to handle this properly.
Just as in #167 it seems like the function stats::get_all_vars would be useful to get the untransformed data used in a formula, but this fails for the cases demonstrated in #167 (comment)
Suggestions appreciated!