We used to be able to directly input an singleEventCB object into visreg::visreg2d and get perspective plots. This is now broken because of commit bb18afd that saves the function call from fitSmoothHazard instead of from the underlying function (e.g. glm or gam).
Solution: We can build a wrapper around visreg::visreg2d, just like we did for visreg::visreg. In that wrapper, we can reshuffle the call to glm (it's stored in fit$lower_call) to avoid the errors downstream, just like we did for plot.singleEventCB:
|
# Switch back call slot |
|
# otherwise we get an error from visreg |
|
x$call <- x$lower_call |
We used to be able to directly input an
singleEventCBobject intovisreg::visreg2dand get perspective plots. This is now broken because of commit bb18afd that saves the function call fromfitSmoothHazardinstead of from the underlying function (e.g.glmorgam).Solution: We can build a wrapper around
visreg::visreg2d, just like we did forvisreg::visreg. In that wrapper, we can reshuffle the call toglm(it's stored infit$lower_call) to avoid the errors downstream, just like we did forplot.singleEventCB:casebase/R/plot_methods.R
Lines 576 to 578 in 3adaa02