Let's consider 3 extreme distributions. Two of them has a very long tail, while the last one is clearly bimodal.
require(poweRlaw)
m = displ$new()
m$setXmin(10);m$setPars(5)
f1 = function(n) {dist_rand(m, n)}
set.seed(2)
n = 200
A = data.frame(x = rep(c(1,2,3), each=n), y = c(f(2*n), f(3*n/4), rnorm(n/4, mean=5000, sd=10)))
ggplot(A, aes(y=y, x=factor(x))) + geom_boxplot()
The long tail make the observation of the difference between the mean hard to tell. So, I wanted to zoom in
ggplot(A, aes(y=y, x=factor(x))) + geom_boxplot() +
scale_y_continuous(limits=c(c(0, 100)))
but the problem is when I zoom in, data that are now outside the plotting frame are not taking into account for creating the boxplot. How can I solve this issue?