R - 让箱线图工作

R - getting box plot to work

boxplot(data=max_urkoma[[2]])

我有一个数据集 max_urkoma[[2]],我想将其放入箱线图中,但它根本不会显示,除非我给它公式 max_urkoma[[1]]~max_urkoma[[2]],然后它基本上只会成为情节上的一组点。我究竟做错了什么?情节就像数据集中的每个项目都是一个单独的对象,我希望它们像下面这样组合在一起:

http://onlinestatbook.com/2/graphing_distributions/graphics/figure4.jpg

这是我的样子http://imgur.com/F2fYPMY

要获得单个箱线图,您可以 boxplot(mtcars$mpg),或者使用您的数据看起来您需要 boxplot(max_urkoma[[2]])