wilkelab/ggridges

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

LukasWallrich opened this issue · 1 comments

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)

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.