我不知道如何将列名和行名引入森林图中。这是数据集:
structure(list(structure(c(5L, 6L, 4L, 3L, 2L, 1L), .Label = c("Austria",
"Denmark", "England", "France", "Portugal", "Spain"), class = "factor"),
Slope = c(-1.8511, -2.33305, -2.698, -1.46, -0.98, -1.401
), low = c(-3.3021, -4.305, -5.873, -4.86, -5.082, -2.887
), high = c(-0.4008, -0.364, -0.087, 2.98, 3.125, -0.054),
bS0 = c(-5.66, -2.709, -4.057, -1.224, -0.574, -1.43), Sf = c(0.354,
0.169, 0.253, 0.077, 0.036, 0.089), `S0-Sf` = c(0.146, 0.126,
0.169, 0.091, 0.061, 0.088)), .Names = c("", "Slope", "low",
"high", "bS0", "Sf", "S0-Sf"), class = "data.frame", row.names = c(NA,
-6L))
这里是获取森林图的脚本:
windows()
forestplot(labeltext=data, graph.pos=3,
mean=c(data$Slope),
lower=c(data$low), upper=c(data$high),
xlab="Regression Coefficient",
txt_gp=fpTxtGp(label=gpar(cex=1),
ticks=gpar(cex=1),
xlab=gpar(cex = 1),
title=gpar(cex = 1)),
col=fpColors(box="black", lines="black", zero = "gray50"),
zero=0, cex=0.9, lineheight = "auto", boxsize=0.1,
lwd.ci=1, ci.vertices=TRUE, ci.vertices.height = 0.1,colgap=unit(4,"mm"))
但是,我想介绍国家名称(我的数据的第 1 列)和列名称。我该怎么做?