Skip to content

Fix partial matching in geom_violin() - #5378

Merged
teunbrand merged 1 commit into
tidyverse:mainfrom
teunbrand:violin_partial_match
Aug 7, 2023
Merged

teunbrand merged 1 commit into
tidyverse:mainfrom
teunbrand:violin_partial_match

Conversation

@teunbrand

Copy link
Copy Markdown
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

@thomasp85 thomasp85 left a comment

Copy link
Copy Markdown
Member

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
@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