I would like to draw some lines across the boxplots produced by base R (specifically, a line at group means, then bounds at ±sqrt(2)*CI). I've found a way to draw dots at the group means, to wit:
mymtcars <- mtcars mymtcars$am <- as.factor(mymtcars$am) boxplot(mpg ~ am, data=mymtcars, boxwex = 0.15) means <- tapply(mymtcars$mpg, mymtcars$am, mean) points(means,col = "red",pch = 18)
...but I'm getting stymied by finding the width of the boxes. The documentation is about three layers deep, and I've tried many combinations of the bxt pars, to no avail.
If it helps, you can see the docs for boxplot which leads to bxp, which has options for both
pars() (listed on the aforementioned
bxp page) and
par(). Some of these set values, some retrieve values, some do both, but I'm having a bit of trouble figuring out which is which.