R:n个索引类别的方框图
我有这个数据。frameR:n个索引类别的方框图,r,ggplot2,boxplot,R,Ggplot2,Boxplot,我有这个数据。frameA row index x y 1 1 0.00129 810.77086 2 1 0.00129 NA 3 1 0.00129 NA 4 1 0.00129 1091.93103 5 1 0.00129 1110.63727 6 1 0.00129 1111.14589 7 1
A
row index x y
1 1 0.00129 810.77086
2 1 0.00129 NA
3 1 0.00129 NA
4 1 0.00129 1091.93103
5 1 0.00129 1110.63727
6 1 0.00129 1111.14589
7 1 0.00129 855.20836
8 1 0.00129 705.51621
9 1 0.00129 593.82147
10 1 0.00129 637.42397
11 1 0.00129 596.95761
12 1 0.00129 584.06459
13 2 0.00133 640.16478
14 2 0.00133 NA
15 2 0.00133 NA
16 2 0.00133 677.74627
17 2 0.00133 749.62762
18 2 0.00133 801.45532
19 2 0.00133 695.72810
20 2 0.00133 684.00883
21 2 0.00133 561.36774
22 2 0.00133 550.28801
23 2 0.00133 590.38698
24 2 0.00133 602.19270
我将基于索引列创建箱线图,我尝试使用ggplot:
p <- ggplot(data=A,aes(x=x,y=y)) +
geom_boxplot(aes(fill=index))
在第2点,R告诉我60750行,因为我的真实数据帧是330250个观察值,索引每1321行改变一次(总共我有250个索引)。预期结果是一个图,其中x轴中有x列,y轴中有一个方框图,每个方框图都是基于列索引的1321值,总共是250个方框图(330250/1321)。
怎么了?如何绘制这些数据 尝试添加
grou
p,如下所示:ggplot(data=A,aes(x=x,y=y))+geom_盒形图(aes(fill=index,group=index))
Yes!!。。。谢谢你…简单!!!
Warning messages:
1: Continuous x aesthetic -- did you forget aes(group=...)?
2: Removed 60750 rows containing non-finite values (stat_boxplot)