仅更改metafor R pacakge中的多边形颜色

时间:2017-02-14 11:55:53

标签: r plot forestplot

我正在尝试制作Data(下图)的森林图,但我想只更改组合研究的多边形的颜色。

代码:

forest(x = data$beta,sei = data$se,
       xlab = " ",
       psize = c(1,2,3,2,4,6),
       pch = c(15,15,15,15,15,18))

然后我想用:

addpoly(x = data$beta,sei = data$se,
        col = c(rep("black",5),"red"),
        pch = c(15,15,15,15,15,18))

但这并没有奏效。颜色仍然是黑色。

数据:

group   beta    se
Study111    -0.043430833437 0.255182175384
Study112    0.808777362855  0.278587375378
Study113    0.233386044408  0.316660371211
Study114    0.237572509459  0.195872577686
Study115    0.541210360393  0.264106181227
Combined    0.741210360393  0.164106181227

1 个答案:

答案 0 :(得分:1)

只需在forest电话中添加颜色:

forest(x = data$beta,sei = data$se,
   xlab = " ",
   psize = c(1,2,3,2,4,6),
   pch = c(15,15,15,15,15,18),
   col = c(rep('black', 5), 'red'))