如何使用 R 中的元包使用 text.addline1 粗体制作额外的文本行?
How to make extra line of text using text.addline1 bold using the meta package in R?
我正在使用 R 中的 meta 包创建森林图。我使用 text.addline1 添加了一行文本(参见图底部)。我如何使该文本加粗?它说请参阅 cran 文档中的“gpar”,但我无法解决。
library(meta)
## make data
df1 <- data.frame(matrix(, nrow=14, ncol=6))
colnames(df1) <- c("estimate", "std.error", "N", "study", "Exposure", "or" )
df1$estimate <- c("1.0588634", "1.0210044", "1.0484577", "0.9872621", "1.0122652",
"0.9934573", "0.9429622", "1.0320382", "0.9654555", "1.0499671", "1.0400071",
"1.0208341", "0.9954885", "0.9879208")
df1$std.error <- c(0.054092871, 0.037674050, 0.093067276, 0.054198110, 0.008714173, 0.010266589,
0.056993648, 0.058017078, 0.058050610, 0.089878607, 0.056951120, 0.011041428,
0.013533755, 0.090526260)
df1$N <- 500
df1$study <- "Study"
df1$Exposure <- "Smoker"
df1$Exposure[7:14] <- "Non smoker"
df1$or <- c(0.057196058, 0.020786829, 0.047320225, -0.012819723, 0.012190549, -0.006564245,
-0.058729114, 0.031535708, -0.035155279, 0.048758876, 0.039227559, 0.020620087,
-0.004521733, -0.012152786)
meta_obj <- metagen(or, std.error, sm = "OR", data = df1,
studlab = study, comb.fixed = TRUE, comb.random = FALSE, byvar = Exposure)
# FOREST ------------------------------------------------------------------
forest(meta_obj, smlab = "Text here", spacing = 1.5,
xlab = "Odds ratio",
xlim = c(0.5, 2),
leftcols = c("studlab", "N"),
col.diamond = "red", col.by = "black",
overall.hetstat = FALSE,
print.I2 = TRUE, print.tau2 = FALSE,
subgroup = T, overall = F,
text.addline1 = "HOW DO I MAKE THIS BOLD?",
ref = 1)
参见参数 'ff.addline':
forest(meta_obj, smlab = "Text here", spacing = 1.5,
xlab = "Odds ratio",
xlim = c(0.5, 2),
leftcols = c("studlab", "N"),
col.diamond = "red", col.by = "black",
overall.hetstat = FALSE,
print.I2 = TRUE, print.tau2 = FALSE,
subgroup = T, overall = F,
ref = 1,
text.addline1 = "USE ARGUMENT 'ff.addline = \"bold\"'",
ff.addline = "bold",
fs.addline = 12,
colgap.left = "2.8cm")
我正在使用 R 中的 meta 包创建森林图。我使用 text.addline1 添加了一行文本(参见图底部)。我如何使该文本加粗?它说请参阅 cran 文档中的“gpar”,但我无法解决。
library(meta)
## make data
df1 <- data.frame(matrix(, nrow=14, ncol=6))
colnames(df1) <- c("estimate", "std.error", "N", "study", "Exposure", "or" )
df1$estimate <- c("1.0588634", "1.0210044", "1.0484577", "0.9872621", "1.0122652",
"0.9934573", "0.9429622", "1.0320382", "0.9654555", "1.0499671", "1.0400071",
"1.0208341", "0.9954885", "0.9879208")
df1$std.error <- c(0.054092871, 0.037674050, 0.093067276, 0.054198110, 0.008714173, 0.010266589,
0.056993648, 0.058017078, 0.058050610, 0.089878607, 0.056951120, 0.011041428,
0.013533755, 0.090526260)
df1$N <- 500
df1$study <- "Study"
df1$Exposure <- "Smoker"
df1$Exposure[7:14] <- "Non smoker"
df1$or <- c(0.057196058, 0.020786829, 0.047320225, -0.012819723, 0.012190549, -0.006564245,
-0.058729114, 0.031535708, -0.035155279, 0.048758876, 0.039227559, 0.020620087,
-0.004521733, -0.012152786)
meta_obj <- metagen(or, std.error, sm = "OR", data = df1,
studlab = study, comb.fixed = TRUE, comb.random = FALSE, byvar = Exposure)
# FOREST ------------------------------------------------------------------
forest(meta_obj, smlab = "Text here", spacing = 1.5,
xlab = "Odds ratio",
xlim = c(0.5, 2),
leftcols = c("studlab", "N"),
col.diamond = "red", col.by = "black",
overall.hetstat = FALSE,
print.I2 = TRUE, print.tau2 = FALSE,
subgroup = T, overall = F,
text.addline1 = "HOW DO I MAKE THIS BOLD?",
ref = 1)
参见参数 'ff.addline':
forest(meta_obj, smlab = "Text here", spacing = 1.5,
xlab = "Odds ratio",
xlim = c(0.5, 2),
leftcols = c("studlab", "N"),
col.diamond = "red", col.by = "black",
overall.hetstat = FALSE,
print.I2 = TRUE, print.tau2 = FALSE,
subgroup = T, overall = F,
ref = 1,
text.addline1 = "USE ARGUMENT 'ff.addline = \"bold\"'",
ff.addline = "bold",
fs.addline = 12,
colgap.left = "2.8cm")