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

Fix partial matching in geom_violin() #5378

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

teunbrand
Copy link
Collaborator

This PR aims to fix #5374.

Briefly, it solves a partial matching bug that would accept weights as the weight aesthetic.
Specifying weights now just throws a warning, instead of being accidentally used as the weight aesthetic.

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2
options(warnPartialMatchDollar = TRUE)

p <- ggplot(iris, aes(Species, Sepal.Width)) + 
  geom_violin(aes(weights = Sepal.Length))
#> Warning in geom_violin(aes(weights = Sepal.Length)): Ignoring unknown
#> aesthetics: weights

Created on 2023-08-02 with reprex v2.0.2

Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@teunbrand teunbrand merged commit 9395629 into tidyverse:main Aug 7, 2023
12 checks passed
@teunbrand teunbrand deleted the violin_partial_match branch August 7, 2023 18:48
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

Successfully merging this pull request may close these issues.

Using weights in geom_density() or geom_violin() give strange warning.
2 participants