Need help to change colour of scepific words in leftcols in R meta::forest

Is there a way of either changing the text colour or adding a background/highlight colour to specific words in a column on a R meta::forest plot please?

I have added a 'Comparator' column using leftcols to denote whether the comparator is a placebo (PBO) or best supportive care (BSC) in the forest plot below/attached. I would like the word PBO to appear in green and BSC in blue (or highlighted in those colours if that is also possible).

This is my code:

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"))

This is the forest plot:

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.