Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add argument for minimal group size in boxplot#6781

Open
teunbrand wants to merge 10 commits intotidyverse:mainfrom
teunbrand:boxplot_minimal_group
Open

Add argument for minimal group size in boxplot#6781
teunbrand wants to merge 10 commits intotidyverse:mainfrom
teunbrand:boxplot_minimal_group

Conversation

Copy link
Collaborator

teunbrand commented Dec 19, 2025

This PR aims to fix #6776.

Instead of mirroring dicook@7dbc03e, the threshold for what constitutes a small group is set via an argument. This preserves the current behaviour, while allowing for the requested behaviour. I'm still open for better argument names than min.group.n.

Note in example below, the first two groups are rendered as points without box and whiskers.

devtools::load_all("~/packages/ggplot2/")
#> i Loading ggplot2
df <- data.frame(
x = rep(LETTERS[1:4], c(1, 5, 10, 50)),
y = rnorm(66)
)

ggplot(df, aes(x, y)) +
geom_boxplot(min.group.n = 6)

Created on 2025-12-19 with reprex v2.1.1

Copy link

jospueyo commented Mar 4, 2026

I was about to issue exactly this. This would be very helpful to me at this moment. May I do something to speed up the process?

Copy link
Collaborator Author

teunbrand commented Mar 4, 2026

This PR would need a review from another maintainer and then the repo as a whole would need to wait until we do a new release. If you need t his today, I think you could indicate to download a PR via pak::pak(), but you may have to puzzle the syntax together a bit.

jospueyo reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Request change to boxplot code to handle tiny data sets better

2 participants