Boxplot in R with visible only average

I want to display only the median for my two datasets. This can also be done using the segment function in R, but I don't know how to do it. So, I decided to use the boxplot function, but still could not figure out how to hide everything and show only medians.

thanks

+7
source share
1 answer

You can set the graphical parameters that are described in ?bxp :

 boxlty: box outline type whisklty: whisker line type staplelty: staple (= end of whisker) line type 

Setting outline = FALSE suppresses outliers in the drawing.

 boxplot(count ~ spray, data = InsectSprays, outline = FALSE, boxlty = 0, whisklty = 0, staplelty = 0) 

must draw a rectangle with horizontal lines in the media.

+8
source

All Articles