Revman 软件在荟萃分析中生成森林图和交通灯图的组合(参见 doi:http://dx.doi.org/10.1136/bmjopen-2018-024444 http://dx.doi.org/10.1136/bmjopen-2018-024444,图3)。我正在使用该包meta
荟萃分析和robvis
存在偏见的风险。以下是使用包中示例数据的一些简单代码:
#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.
以下是一些开始构建情节的想法。
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))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)