在 R 中修改森林图

Modifying forestplot in R

我正在尝试使用以下代码创建森林图,但它不起作用:

tabletext<-cbind(c("Study", "2.1", "27", "30.1", "40",NA,"Summary"), c("Events", "4", "5", "1", "14",NA,NA), c("Totals", "32", "10", "8", "28",NA,NA), c("LO", "-1.95", "0.00", "-1.95", "0.00",NA,"-0.85")) 

cochrane_from_meta<-structure(list(mean=c(NA,-1.95, 0.00, -1.95, 0.00,NA,-0.85), lower=c(NA,-2.99, -1.24, -4.04, -0.74,NA,-1.96), upper=c(NA,-0.90, 1.24, 0.15, 0.74,NA,0.27)), .Names=c("mean", "lower", "upper"), row.names=c(NA, -11L),class="data.frame")

 forestplot(tabletext, cochrane_from_meta, new_page=TRUE, clip=c(0.1, 2.5), xlog=TRUE, is.summary=c(TRUE, TRUE, rep(FALSE,5), TRUE), col=fpColors(box="royalblue", line="darkblue", summary="royalblue"))

我不断收到相同的错误消息:

Error in prFpConvertMultidimArray(mean) : 
  Sorry did not manage to automatically identify the upper/lower boundaries.

如有任何帮助,我们将不胜感激!

编辑:

我希望我的情节如下所示:

从第一个答案中的代码生成的图表在这里:

以下语法有效:

cochrane_from_rmeta <- 
structure(list(
mean  = c(NA, NA, 0.578, 0.165, 0.246, 0.700, 0.348, 0.139, 1.017, NA, 0.531), 
lower = c(NA, NA, 0.372, 0.018, 0.072, 0.333, 0.083, 0.016, 0.365, NA, 0.386),
upper = c(NA, NA, 0.898, 1.517, 0.833, 1.474, 1.455, 1.209, 2.831, NA, 0.731)),
.Names = c("mean", "lower", "upper"), 
row.names = c(NA, -11L), 
class = "data.frame")

不知何故函数:

 prFpConvertMultidimArray(mean)

对它转换的对象类型非常挑剔。