b*****e 发帖数: 223 | 1 Havn't fixed the problem in the past two days. My poor R skills .....
I can get the stacked barplot, but whenever I tried to use the option of
beside=T, it gives me the same error message.
mybar <- barplot (as.matrix (trsk01 [c(2,3), c(1,2)]), ylim=c(0, ymax),
axisnames=FALSE, main="Plot of PSI = 6", beside=T )
Error in -0.01 * height : non-numeric argument to binary operator
data is here:
> trsk01
28 29 30 31 32 33 34
35
psi a_I_bypass aaa_endo aaa_open above_knee below_knee leg_bypass ll_endart
nec_cea
risk 3.809 1.632 -0.100 1.623 1.021 1.228 1.403
0.078
elec 4.053 1.689 -0.100 -0.100 0.000 0.696 0.936
0.000
lci 3.5276 1.4439 -0.1200 1.4823 0.8806 1.1049 1.2496
0.0000
uci 4.0900 1.8208 -0.0800 1.7636 1.1606 1.3505 1.5574
0.1711
natn 0.5 0.5 0.5 0.5 0.5 0.5 0.5
0.5
36
psi periph_art_ango
risk 0.429
elec 0.360
lci 0.3588
uci 0.4993
natn 0.5 | D*********2 发帖数: 535 | 2 what did I miss here, u try to make boxplot out of four points? | b*****e 发帖数: 223 | 3 no, it's barplot. each value gives the height of the bar.
【在 D*********2 的大作中提到】 : what did I miss here, u try to make boxplot out of four points?
| a********s 发帖数: 188 | 4 似乎没有错啊, 不知道你定义的ymax是什么? 会不会它有问题? | b*****e 发帖数: 223 | 5 应该不会,我定义的 ymax 是 最大值的1.3倍
我感觉是数据类型的错误。R 里面乱七八糟的数据类型一直让我很头痛,我知道
barplot 需要 vector or matrix,但是还是搞不定,头大不得了。这个图我用 sas 画
过一遍了,但是没有 R 的漂亮,想用 R 做一遍结果憋死了憋不出来,很衰
【在 a********s 的大作中提到】 : 似乎没有错啊, 不知道你定义的ymax是什么? 会不会它有问题?
| b*****n 发帖数: 685 | 6 trsk01 [c(2,3), c(1,2)]看了是什么? |
|