Skip to content

Add support for weighted quantiles in geom_violin() - #6853

Open
hughjonesd wants to merge 5 commits into
tidyverse:mainfrom
hughjonesd:main
Open

Add support for weighted quantiles in geom_violin() #6853
hughjonesd wants to merge 5 commits into
tidyverse:mainfrom
hughjonesd:main

Conversation

@hughjonesd

Copy link
Copy Markdown

This very small change adds support for weighted quantiles in geom_violin() via stat_ydensity(), using Hmisc::wtd.quantile().

It scratches an itch I've experienced myself, working with weighted data in ggplot2.

@hughjonesd

Copy link
Copy Markdown
Author

Thought I'd see if I could get someone to review this! It's very short.

@teunbrand teunbrand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Mostly looks good to me, I've left a few suggestions

Comment thread R/stat-ydensity.R Outdated
Comment thread tests/testthat/test-stat-ydensity.R Outdated
Comment thread NEWS.md Outdated
hughjonesd and others added 3 commits August 15, 2026 19:39
Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com>
Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com>
Co-authored-by: Teun van den Brand <49372158+teunbrand@users.noreply.github.com>
@hughjonesd

Copy link
Copy Markdown
Author

Thanks for these catches!

@teunbrand

teunbrand commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Snapshot failures appear unrelated to PR. This PR should be good to go once snapshots have stabilised, which would be a separate PR.

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.

2 participants