-
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
Fix error message for geom_density() when using y #3514
Comments
Hi Dale, |
Hi Mara, Thanks for asking though. |
Completely understood! |
I agree about the error message, but I don't feel it's nice to use |
Question 1Should this have been closed as indicated in #3519 ? Question 2Looks like a check for/warning of 'supplied x and y but specified stat="density" by default') could be applied in Right track ? I'll be looking through other geom- source for similar compatibility checks. My Notes |
@thomasp85 , sorry if I misunderstood this, but it seems the issue as described by @Maschette is still the same in ggplot2 3.3.2: x <- data.frame(value = seq(0, 1, by = 0.2),
count = rnorm(6, mean = 10))
library(ggplot2)
ggplot(x) +
geom_density(aes(x = value, y = count))
#> Error: geom_density requires the following missing aesthetics: y Created on 2020-08-10 by the reprex package (v0.3.0) |
Same for v3.3.5 |
@Maschette this helped me solve the error message, when nothing else on the internet did. Thank you. |
Hi,
The error message for geom_density() when using x and y comes up and says y is missing. My suggestion would be to change the error when x and y are present but stat is not identity to "y is present, did you mean to use stat = 'identity'" or something like that. Also adding an example that uses x and y to https://ggplot2.tidyverse.org/reference/geom_density.html would be great.
Created on 2019-09-02 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: