如何在图形中制作 2 个箱线图

时间:2021-05-14 12:54:23

标签: r ggplot2 boxplot

我有这种数据。

extra   group   ID
0.7     1   1
-1.6    1   2
-0.2    1   3
-1.2    1   4
-0.1    1   5
3.4     1   6
3.7     1   7
0.8     1   8
0       1   9
2       1   10
1.9     2   1
0.8     2   2
1.1     2   3
0.1     2   4
-0.1    2   5
4.4     2   6
5.5     2   7
1.6     2   8
4.6     2   9
3.4     2   10

我尝试过这样过滤群组:

group1 <- filter(df, df$group == 1)
group2 <- filter(df, df$group == 2)

我希望我的图形看起来像这样 enter image description here

0 个答案:

没有答案