需要在 R meta::forest 的左列中改变特殊词的颜色

问题描述 投票:0回答:0

有没有办法改变文本颜色或为 R meta::forest plot 上的列中的特定单词添加背景/突出显示颜色?

我在下面/所附的森林图中添加了一个使用 leftcols 的“比较器”列来表示比较器是安慰剂 (PBO) 还是最佳支持治疗 (BCS)。我希望 PBO 这个词以绿色显示,BSC 以蓝色显示(如果可能的话,也可以用这些颜色突出显示)。这是我的代码:

library(meta)

dat.1 <- data.frame(Study_name = c("Study 1", "Study 2", "Study 3", "Study 4", "Study 5", "Study 6"),
                    Tmt_D =c(1, 59, 6, 301, 5, 22),Tmt_T =c(43, 541, 41, 2750, 396, 158),
                    Con_D =c(3, 77, 5, 303, 4, 10),Con_T =c(58, 521, 41, 2725, 200, 79),
                    Comparator = c("PBO", "PBO", "BSC", "PBO", "BSC", "PBO"))

bin.1 <- metabin(event.e=Tmt_D, n.e=Tmt_T, event.c=Con_D, n.c=Con_T, 
                 studlab=Study_name,data= dat.1,method="inverse",sm="RR",
                 prediction=TRUE)

for.1 <- forest(bin.1, text.common = "FE model", text.random = "RE model",
                text.predict = "Prediction Interval", text.w.common = "fixed",
                text.w.random = "random",label.e = "Active treatment", 
                label.c = "Comparator", label.right = "Favours comparator", 
                label.left = "Favours Active tmt", 
                leftcols = c("studlab", "event.e", "n.e", "event.c", "n.c", "Comparator"))

这是森林地块 enter image description here

我已经阅读了所有 meta::forest 参数,但无法在那里找到解决方案。也做了很多网络搜索。

r meta forestplot
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.