我正计划制作堆栈条形图,就像 在 R
我有没有任何标题的表格格式的原始数据(每行包含七个值):
1.028 1.125 1.475 0.793 0.803 0.815 0.974
0.867 1.115 1.256 1.377 1.029 1.184 1.135
0.497 0.400 0.313 0.570 0.319 0.558 0.475
0.541 0.646 0.309 0.692 0.813 0.575 0.806
1.153 1.184 0.792 0.666 0.976 0.607 0.706
1.236 1.049 1.424 1.773 1.019 0.910 1.376
我的计划是首先为每行制作步长为 1 的不同间隔的箱。
0-1 1-2 2-3
4 3 0
1 6 0
...
其次,在 x 轴上制作每行间隔的堆叠条。
我做了很多谷歌搜索。我停在了这里......
> mytable = read.table("./temp.out")
> m <-apply(mytable, 1, cut, seq(0, 3, 1))
> m
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(0,1]" "(1,2]" "(1,2]"
[2,] "(1,2]" "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(1,2]" "(1,2]"
[3,] "(1,2]" "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(0,1]" "(1,2]"
[4,] "(0,1]" "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(0,1]" "(1,2]"
[5,] "(0,1]" "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(0,1]" "(1,2]"
[6,] "(0,1]" "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(0,1]" "(0,1]"
[7,] "(0,1]" "(1,2]" "(0,1]" "(0,1]" "(0,1]" "(0,1]" "(1,2]"
之后,我无法在频率表中将其转换为
0-1 1-2 2-3
4 3 0
1 6 0
...
你能建议我如何制作频率表吗?得到频率表后,这些数据可以绘制在堆栈栏中吗?