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

Warning regarding weights in stat_binline - but they seem to be used? #76

Open
LukasWallrich opened this issue Feb 9, 2022 · 1 comment

Comments

@LukasWallrich
Copy link
Contributor

Last issue from me for today, sorry to keep it coming.

When using weight with stat_binline, a warning states that this aesthetic is ignored. Nevertheless, the output changes, which makes sense since stat_bin supports weights. Now I am not sure whether I can ignore that warning - if so, should the warning be removed?

library(ggridges)
library(ggplot2)

ggplot(mtcars, aes(x=mpg, y=factor(am)))+geom_density_ridges(stat = "binline", aes(weight = cyl))
#> Warning: Ignoring unknown aesthetics: weight
#> `stat_binline()` using `bins = 30`. Pick better value with `binwidth`.

ggplot(mtcars, aes(x=mpg, y=factor(am)))+geom_density_ridges(stat = "binline")
#> `stat_binline()` using `bins = 30`. Pick better value with `binwidth`.

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

@clauswilke
Copy link
Collaborator

Honestly I have no idea what is happening here. I would recommend making a simpler example so you can examine whether the weights are actually applied correctly or not.

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