Skip to content

Discarding boxplot outliers - #5379

Merged
teunbrand merged 5 commits into
tidyverse:mainfrom
teunbrand:boxplot_outliers
Aug 7, 2023
Merged

teunbrand merged 5 commits into
tidyverse:mainfrom
teunbrand:boxplot_outliers

Conversation

@teunbrand

Copy link
Copy Markdown
Collaborator

This PR aims to fix #4892.

Briefly it adds an outliers switch to geom_boxplot() that can turn outliers on or off, in a manner that does affect the scale ranges, in contrast to setting outliers.shape = NA.

Small demo:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

ggplot(mpg, aes(hwy, class)) +
  geom_boxplot(outliers = FALSE)

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

Comment thread R/geom-boxplot.R
Comment on lines +40 to +41
#' only, not the full data range. If outliers need to be hidden and the axes
#' needs to show the full data range, please use `outlier.shape = NA` instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It felt more appropriate to distinguish discarding vs hiding here than to keep the documentation over at the outlier.shape paragraph.

@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 df1b901 into tidyverse:main Aug 7, 2023
@teunbrand
teunbrand deleted the boxplot_outliers branch August 7, 2023 18:26
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.

geom_boxplot outliers

2 participants