This question already has an answer here:
I have some data that I'm trying to build some boxplots with, but I'm getting this error:
Warning message: Removed 1631 rows containing non-finite values (stat_boxplot).
There are no NA
values and all the data seems fine. How can I fix this as these are certainly valuable points in my data and should be extended by the whiskers?
Data
The data is fairly large, and I couldn't get a smaller subsample to produce the errors, so I'll just post the original data.
ggplot2
dat <- readRDS("./dat.rds")
ggplot(dat, aes(x = factor(year), y = dev)) + geom_boxplot() + ylim(-40, 260)
Edit
I was able to get it to work in boxplot
with `range = 6'. Is there a way to do this in ggplot?
boxplot(dev~year, data = d, range = 6)
Remove the
ylim
restriction and use thecoef
argument ofgeom_boxplot
, then it works fine: