Closed xrobin closed 1 year ago
Note that this style also doesn't work with standard R functions such as glm
:
form <- as.formula("outcome ~ wfns")
with(df, glm(form))
This is because it is the environment of the formula which matters. So that works instead:
form <- with(aSAH, as.formula("age ~ ndka"))
glm(form)
And it works as well with pROC currently:
form <- with(aSAH, as.formula("outcome ~ wfns"))
roc(form)
The solution is pretty ugly and may not be optimal, but the combination is now working and tested.
There will probably be edge cases where it doesn't work and the search should be loosened further. However it works in testthat tests.
This is a follow-up of #101.
Throws an error: