2

The software Revman produces a combination of forest plots and traffic light plots in meta-analyses (see e.g. doi: http://dx.doi.org/10.1136/bmjopen-2018-024444, Fig. 3). I am using the package meta fot meta-analysis and robvis for risk of bias. Here is some simple code using example data from the packages:

#creating a forest plot
library(meta)
m <- metacont(n.amlo, mean.amlo, sqrt(var.amlo),
              n.plac, mean.plac, sqrt(var.plac),
              data = amlodipine, studlab = study)
forest(m)

#creating a risk of bias traffic light plot
library(robvis)
rob_traffic_light(data_rob2, tool = "ROB2")

The important thing is that the rows (i.e. each single study) from the forest plot and the rows from the risk of bias plot are aligned. The problem with using packages such as gridExtra is that you have to play around with the alignment and size or the plots until it fits. My question is if there is a good workaround in R to get plots that are similar to the Revman-plots. The result should look like the figure below.enter image description here

ehi
  • 409
  • 8
  • 23
  • What do you mean by "_similar_ to the Revman-plots?" If you want to combine multiple plots into a figure, other R packages like `gridExtra` or `cowplot` allow you to do so with ggplots. Here is a thread with some options: https://stackoverflow.com/q/1249548/6288065 – LC-datascientist Dec 08 '20 at 17:59
  • 1
    The important thing is that the risk of bias items are aligned with the study name. If you try to do this with gridExtra, you would have to play around with each plot until the studies from the forest plot are aligned with the risk of bias-row. I hope this makes sense.. – ehi Dec 08 '20 at 18:30
  • 1
    This is being added to the `robvis` package at the moment. See: https://github.com/mcguinlu/robvis/issues/102 Might be able to get this to work if you install the development version of the package. – Wolfgang Dec 08 '20 at 19:31

1 Answers1

0

Here are some ideas to start building your plot.

library(meta)
data(amlodipine)
m <- metacont(n.amlo, mean.amlo, sqrt(var.amlo),
              n.plac, mean.plac, sqrt(var.plac),
              data = amlodipine, studlab = study)  

library(ggplotify)
p1 <- as.ggplot(~forest(m), scale = 1, hjust = 0, vjust = 0)

library(robvis)
p2 <- rob_traffic_light(data_rob2, tool = "ROB2")

library(patchwork)
graphics.off()
dev.new(width=15,height=6)
wrap_plots(p1, p2, widths=c(9,2), heights=c(15,1))

enter image description here

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58