How would I ignore outliers in ggplot2 boxplot? I don't simply want them to disappear (i.e. outlier.size=0), but I want them to be ignored such that the y axis scales to show 1st/3rd percentile. My outliers are causing the "box" to shrink so small its practically a line. Are there some techniques to deal with this?
Edit Here's an example:
y = c(.01, .02, .03, .04, .05, .06, .07, .08, .09, .5, -.6)
qplot(1, y, geom="boxplot")
fivenum()
on the data to extract what, IIRC, is used for the upper and lower hinges on boxplots and use that output in thescale_y_continuous()
call that @Ritchie showed. This can be automated very easily using the tools R and ggplot provide. If you need to include the whiskers as well, consider usingboxplot.stats()
to get the upper and lower limits for the whiskers and use then inscale_y_continuous()
. – Gavin Simpson