hadley/ggplot2 — Issue #281: geom_boxplot behaves differently from boxplot
Author: wch
Created: 2011-12-07 10:15:04+00:00
State: open

I was testing some of the examples from the help page, and noticed that `geom_boxplot` has slightly different output from the `boxplot` function. If you look at these two graphs, you'll notice that `ggplot` has an outlier at 19.2, but `boxplot` doesn't.

```R
ggplot(mtcars, aes(factor(cyl), mpg)) + geom_boxplot() + ylim(10,35)

boxplot(mpg ~ cyl, mtcars)
```

The output of `boxplot` seems to be consistent with `boxplot.stats`, so my guess is that there's something wrong with `stat_boxplot`.

```R
boxplot.stats(subset(mtcars, cyl==8)$mpg)
#$stats
#[1] 13.3 14.3 15.2 16.4 19.2
#
#$n
#[1] 14
#
#$conf
#[1] 14.31323 16.08677
#
#$out
#[1] 10.4 10.4
```