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

Issue with check_required_aesthetics() - y not found #73

Open
LukasWallrich opened this issue Feb 9, 2022 · 2 comments
Open

Issue with check_required_aesthetics() - y not found #73

LukasWallrich opened this issue Feb 9, 2022 · 2 comments

Comments

@LukasWallrich
Copy link
Contributor

Thanks for this great package & please note that I have not encountered this issue in production but just when playing around - but I still wanted to report it just in case it matters.

In the code below, I get an error message claiming that the y-aesthetic is missing, while it is clearly provided and also picked up by other geoms.

library(ggridges)
library(ggplot2)
ggplot(mtcars, aes(x = mpg, y = cyl)) + geom_density_ridges()
#> Picking joint bandwidth of 2.48
#> Error in `check_required_aesthetics()`:
#> ! geom_density_ridges requires the following missing aesthetics: y
@clauswilke
Copy link
Collaborator

Not sure why the error message is what it is. The problem is that the y aesthetic needs to be discrete.

library(ggridges)
library(ggplot2)
ggplot(mtcars, aes(x = mpg, y = factor(cyl))) + 
  geom_density_ridges()
#> Picking joint bandwidth of 1.38

Created on 2022-02-09 by the reprex package (v2.0.0)

@LukasWallrich
Copy link
Contributor Author

So simple - but not something I would have figured out anytime soon from that error ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants