I would like to put perpendicular lines at the ends of the whiskers like the boxplot
function automatically gives.
R – Put whisker ends on boxplot
boxplotggplot2r
boxplotggplot2r
I would like to put perpendicular lines at the ends of the whiskers like the boxplot
function automatically gives.
Best Answer
As hinted but not implemented by @Roland, you can use
stat_boxplot
to implement this. The trick calling_boxplot
twice and is to set thegeom
toerrorbar
for one of the calls.Note that as
R
uses a pen and paper approach it is advisable to implement the error bars first the draw the traditional boxplot over the top.Using @Roland's dummy data
df
The help for
stat_boxplot
(?stat_boxplot
) detail the various values computed and saved in adata.frame