-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Uninformative error for piping into facets #4379
Comments
Thanks, I think we can show similar error message on facets too, but,
is this really a common mistake? I think the realistic code would be something like below. But, I think it's only after the user figured out the fact that ggplot2 uses p <- ggplot(diamonds) +
geom_point(aes(price, carat))
# print w/o facetting
p
# print w/ facetting
p %>%
facet_wrap(vars(cut)) |
In this particular case, we were using an <tsibble> %>%
autoplot() %>%
facet_wrap(vars(col)) |
Ah, makes sense. |
PR in #4385. It required a bit of re-ordering in some places, so I collected the other check for using |
Oh, sorry I didn't notice it needed some more efforts... Thanks for your contribution! |
Once of my students mistook
%>%
for+
when adding facets and couldn't determine the problem based on the error message.It would be nice if the hint for piping layers (
"Did you use %>% instead of +?"
) was also provided if the first argument for facets was a ggplot object.Created on 2021-03-18 by the reprex package (v1.0.0)
Session info
The text was updated successfully, but these errors were encountered: