I'm really scratching my head here. I really don't understand what is going on. This is a MWE, but the actual code and purpose is more complex then this. So the code:
library(dplyr)
ds <- mutate(iris, Species = as.numeric(Species == 'setosa'))
ds %>%
do_(
.dots = lazyeval::interp(
"broom::tidy(stats::glm(form, data = ., family = distr))",
form = Species ~ Sepal.Length,
distr = binomial()
)
)
Which returns: Error in family$linkfun(mustart) : object 'C_logit_link' not found
... but this code bit works fine:
ds %>%
do_(
.dots = lazyeval::interp(
"broom::tidy(stats::glm(form, data = ., family = distr))",
form = Sepal.Width ~ Sepal.Length,
distr = gaussian()
)
)
The only difference between the two is the family distribution used (gaussian vs binomial) and the variable used.
So the question: why is it that lazyeval can't find C_logit_link
?