Skip to content

Conversation

@teunbrand
Copy link
Collaborator

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/")
#> ℹ 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

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.

Request change to boxplot code to handle tiny data sets better

1 participant