我希望能够仅绘制我的两个数据集的中位数。在R中,可以使用segments函数进行操作,但我不知道该如何操作。因此,我决定使用boxplot函数,但仍然无法弄清楚如何隐藏所有内容并仅显示中位数。
谢谢
?bxp
文档下记录的图形参数:boxlty: box outline type
whisklty: whisker line type
staplelty: staple (= end of whisker) line type
outline = FALSE
会阻止绘制异常值。
boxplot(count ~ spray, data = InsectSprays, outline = FALSE, boxlty = 0,
whisklty = 0, staplelty = 0)
应绘制一个箱线图,只需在中位数处绘制水平线。