繁体   English   中英

在森林图中将特定行的字体更改为粗体

[英]Change font of specific rows to bold in forestplot

我使用“forestplot”package 编写了一个脚本。 我想将变量分组到某些类别中,我想以粗体显示,以突出这些类别。 如何调整我的脚本,以便只有某些行,即风险因素 OR (95% CI)、患者特征、用药史、合并症、手术史等以粗体显示? 我有两列和 18 行。 有人能帮我吗? 我将不胜感激:! 我的脚本如下:

tabletext <- cbind(
  c("Risk factor" ,"Patient characteristics","Sex, male*", "Bmi (5 points)", 
    "Alcohol (5 units)", "Smoking*","Medication history",
    "Steroid use", "Anticoagulant use*","Comorbidities",
    "COPD GOLD 1/2", "COPD GOLD 3/4", "Other pulmonary disease",
     "Surgical history",
    "Previous colorectal surgery*", 
    "Previous abdominal surgery (other)","Other", "HIPEC*"),
  c("OR (95% CI)",NA, "1.78 (1.20-2.68)", "1.15 (0.95-1.38)", "1.04 (0.94-1.14)",
    "1.78 (1.11-2.80)", NA," 1.40 (0.68-2.67)", "1.55 (1.02-2.32)",NA, 
    "1.40 (0.70-2.61)", "1.56 (0.42-4.67)", "1.78 (0.63-4.28)",NA,
    "1.61 (1.03-2.49)", "0.80 (0.47-1.32)",NA, "4.14 (2.14-7.73)"))


?fpTxtGp
require(forestplot)
forestplot(tabletext,
txt_gp = fpTxtGp(label = list(gpar(fontfamily = "Times",
                                   fontface="bold"),
                       gpar(fontfamily = "",
                                              col = "black"))),
  df_c,new_page = TRUE,
           boxsize = 0.2,
           is.summary = c(rep(FALSE,32)),
           clip = c(0,17),
  xlab = 'Odds ratio with 95% confidence interval
  * indicates significance',
  xlog = FALSE, 
           zero = 1,
  plotwidth=unit(12, "cm"),
  colgap=unit(2, "mm"),
  
           col = fpColors(box = "royalblue",
                          line = "darkblue",
                          summary = "royalblue"))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM