Skip to content

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

@twest820

Description

@twest820

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers 📈messagesrequests for improvements to error, warning, or feedback messages

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions