做龙卷风图时,运行代码,报了warning,无法显示图。
图的代码
library(RColorBrewer)
mycolors<-brewer.pal(4,"Set1")
options(scipen = 200)
p<- plot(res_dsa, type = "difference",result = "icer",remove_ns = TRUE,
resolve_labels = TRUE,limits_by_bars = FALSE,shorten_labels = TRUE)+
scale_color_manual(values = mycolors[c(1,3,2,2)]) + #自定义颜色
theme_classic()+
# scale_x_continuous(breaks=seq(-300000, 700000, 100000))+
geom_vline(aes(xintercept=-23013.864),color="black")+
# geom_vline(aes(xintercept=100000),color=mycolors[3],linetype = "dashed")+
geom_vline(aes(xintercept=150000),color=mycolors[3],linetype = "dashed")+
ggtitle("Tornado Diagrams of Univariable Sensitivity Analyses")+
xlab("ICER, $/QALY") +
theme(
axis.text.x=element_text(),
strip.placement = "outside",
strip.background = element_rect(),
plot.title = element_text(family='Times', face='bold.italic',size = 22),
axis.text = element_text(color = "black",size = 12),
axis.title.x = element_text(family = 'Times',face = 'bold',size =15),
axis.title.y = element_text(family = 'Times',face = 'bold',size=10),
)
p
pdf(file = "Tornado Diagrams.pdf",width = 10,height = 6)
p
然后是warning提示:
Warning messages:
1: Removed 96 rows containing missing values (geom_vline()
).
2: Removed 96 rows containing missing values (geom_vline()
).