Skip to content
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

Feature Request: Make Missing mapping Errors More Informative #2706

Closed
billdenney opened this issue Jun 20, 2018 · 4 comments · Fixed by #2754
Closed

Feature Request: Make Missing mapping Errors More Informative #2706

billdenney opened this issue Jun 20, 2018 · 4 comments · Fixed by #2754

Comments

@billdenney
Copy link
Contributor

When generating a plot recently, I accidentally left out the mapping. When running the code, I got an uninformative error indicating that the mapping was missing. Can the errors for missing mappings be improved to indicate something similar to "No mapping provided for required aesthetic 'x'" (and similar)?

library(ggplot2)         
ggplot(data.frame(A=1)) +
geom_line()              
#> Error in order(data$PANEL, data$group, data$x): argument 3 is not a vector
@Ax3man
Copy link
Contributor

Ax3man commented Jun 25, 2018

This error is specific to geom_line it seems.

@hadley
Copy link
Member

hadley commented Jun 25, 2018

Yes, this is already done in general; but geom_line() seems to have slipped through the cracks.

@dpseidel
Copy link
Collaborator

This is a variant of the same issue documented in #2637. The error is caused because Geom*$setup_data runs before check_required_aes() in layer$compute_geom_1(). I'm testing the fix and should have a PR shortly.

@lock
Copy link

lock bot commented Feb 3, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Feb 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants