-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
An easier way to remove outliers and expand the boxplots to fill the graph would be nice.
This does work but I would have thought that there would be some less manual way of doing it.
library(ggplot2)
xlim_ <- range(boxplot.stats(mpg$hwy)$stats)
ggplot(mpg, aes(hwy, class)) +
geom_boxplot(outlier.shape = NA) +
xlim(xlim_)
#> Warning: Removed 3 rows containing non-finite values (`stat_boxplot()`).In classical graphics outline=FALSE will both omit outliers and cause boxes to fill the graph.
boxplot(hwy ~ class, mpg, outline = FALSE, horizontal = TRUE)
