-
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
Warn when a supplied mapping is going to be overwritten by geom_hline / vline / abline #2950
Conversation
…oing to be overwritten.
Is it OK to recommend to place values directly in Maybe preparing data is the right thing? Or considering the hacky nature of the "annotation mode", is this allowed specially? |
Actually, Lines 13 to 17 in 3550772
should only be executed when data is NULL .
|
I meant not providing data2 <- data
data2$y <- 3
geom_hline(data = data2,
aes(yintercept = y, colour = colour)) But, please ignore my comment above. I think I don't get the setantics of variable mappings yet. Sorry for the noise. |
Are any further changes needed here?
(I'm not sure what's up with travis - the error says something about exceeding the API rate limit?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a few specific comments. We would also need an entry in NEWS.md.
This cannot currently be merged because the code in @RichardJActon Would you mind updating this? Could you please also add a bullet to NEWS.md? It should briefly describe the change and end with |
Hi @clauswilke, At present with just adding the warning message this won't break anyones code but if someone has supplied data that is currently being overwritten silently this change might cause them issues. I expect I can update this later today but do we want it with or without the change to the data overwrite behaviour? |
We just opened a separate issue about the overwriting of |
Thanks! |
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/ |
This pull request addressed issue #2945
geom_hline / vline / abline will now throw a warning if the user supplies both a x|y|intercept/slope value and a mapping such as this:
As the above will cause the user supplied mapping to be ignored/overwritten
Users might resaonably expect the above to work as other geoms do not have this behaviour. The warning messages suggest that the x|y|intercept/slope value(s) be moved inside the aes call thus: