-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
augment with do fails on lm(y ~ poly(x)) #289
Comments
The problem is that in the augment output, the This is definitely a problem for augment in general (should we always force the output columns from model.frame() to be vectors? What kind of error could we give?) But it has a workaround in this case of giving the data argument to bind_rows(a = mcycle, b = mcycle, .id = "ver") %>%
group_by(ver) %>%
do({
fit = lm(accel ~ poly(times, degree = 2), data = .)
augment(fit, data = .)
}) |
Ah ok, that makes sense. And the workaround works perfectly - thanks! |
My take is that |
Closing in favor of #405. Eventually matrix-column support in tibbles will arrive and this will just work. |
I am having difficulty seeing how to apply this solution to nested data. In that case, If I declare the augment with
After some discussion on SO, I see that we can get the output via:
|
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
I am getting an error when I use
augment
withindo
. My quantile regression model usessplines::bs(...)
as the predictor, but the problem can be replicated withlm
usingpoly
.The text was updated successfully, but these errors were encountered: