试图在 R 中制作森林图。但我的并没有显示拂尘,这在森林图示例中很常见。另外我想摆脱情节底部的蓝色钻石。请对代码提出建议。代码运行但没有产生理想的结果。
下面是我的 R 代码
cochrane_from_rmeta <-
structure(list(
mean = c(NA, NA, 1.16, 1.18, 1.22, 1.24, 1.19, 1.17, 1.14, 1.28, NA),
lower = c(NA, NA, 1.14, 1.17, 1.20, 1.22, 1.18, 1.15, 1.13, 1.27, NA),
upper = c(NA, NA, 1.16, 1.19, 1.23, 1.26, 1.21, 1.19, 1.15, 1.29, NA)),
.Names = c("mean", "lower", "upper"),
row.names = c(NA, -11L),
class = "data.frame")
tabletext<-cbind(
c("", "Disaster", "Frances", "Ivan",
"Katrina", "Wilma", "Rita", "Ike",
"Irene", "Sandy", ""),
c("Hospitalization", "Exposure", "52,601", "74,511",
"20,966", "22,150", "20,964", "19,472",
"47,116", "58,963", NA),
c("Hospitalization", "Non-exposure", "525,228", "730,144",
"197,795", "207,937", "203,007", "192,782",
"474,373", "541,190", NA),
c("", "IRR", "1.16", "1.18",
"1.22", "1.24", "1.19", "1.17",
"1.14", "1.28", NA))
forestplot(tabletext,
cochrane_from_rmeta,new_page = TRUE,
is.summary=c(TRUE,TRUE,rep(FALSE,8),TRUE),
clip=c(0.9,2.5),
xlog=TRUE,
col=fpColors(box="royalblue",line="darkblue", summary="royalblue"))
结果是