R中数据的并排箱形图(在一个图中)

时间:2020-04-07 19:32:29

标签: r boxplot

boxplot(s2040_W20_fishjump$Distance, main = "Fish Jump Distance", xlab = "Control vs Treatment", ylab = "Distance")

为我返回一个带有适当标签但只有一个箱形图的图。我需要根据“控制”与“治疗”对图进行划分,但无法弄清楚如何做。

这是我正在使用的数据集

Here is the data set I am working with

任何帮助将不胜感激,谢谢。

1 个答案:

答案 0 :(得分:1)

使用波浪号:

boxplot(s2040_W20_fishjump$Distance ~ s2040_W20_fishjump$Treatment, main = "Fish Jump Distance", xlab = "Control vs Treatment", ylab = "Distance")