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

apparently spurious unknown aesthetic warning from geom_bin2d(aes(weight)) #4646

Closed
twest820 opened this issue Oct 19, 2021 · 0 comments · Fixed by #4666
Closed

apparently spurious unknown aesthetic warning from geom_bin2d(aes(weight)) #4646

twest820 opened this issue Oct 19, 2021 · 0 comments · Fixed by #4666
Labels
bug an unexpected problem or unintended behavior layers 📈 messages requests for improvements to error, warning, or feedback messages

Comments

@twest820
Copy link

The discussion in #1967 indicates geom_bin2d() has supported a weight aesthetic since at least 2017 (though it continues to be undocumented). However, when I include weight = <column> in aes() a warning is emitted saying weight is ignored. Even though it's actually getting used (the difference between weighted and unweighted is obvious in my dataset as well as when removing the weight aesthetic from the repex below).

# this gives a plot with count = weight as expected but...
data = tibble(x = seq(-5, 5), y = seq(-5, 5), weight = seq(1, 11))
ggplot(data) + geom_bin2d(aes(x = x, y = y, fill = ..density.., weight = weight))
# also says
# Warning message:
# Ignoring unknown aesthetics: weight 

A workaround to avoid this warning is given in this StackOverflow question but, as I've several million observations in my data with a fairly wide range of weights, it's more practical just to ignore the warning.

@thomasp85 thomasp85 added bug an unexpected problem or unintended behavior layers 📈 messages requests for improvements to error, warning, or feedback messages labels Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior layers 📈 messages requests for improvements to error, warning, or feedback messages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants