【问题标题】:Plotting a multipanel survival plot with risk tables using ggarrange使用 ggarrange 绘制带有风险表的多面板生存图
【发布时间】:2022-12-11 11:04:12
【问题描述】:

我使用 survminer 库制作了一些带有风险表(序列和组织学)的不错的生存图。

资料在https://drive.google.com/file/d/1Svtmyj9w968toggDshLg9eYex9N_fws5/view?usp=share_link

资料在https://drive.google.com/file/d/1LZmQDFXSv8drJHBC2lS1av7TEIPva5Z9/view?usp=share_link

library(ggplot2)
library(ggpubr)
library(survminer)

sequence=readRDS("sequence.rds")

histology=readRDS("histology.rds")


sequence
histology

我可以使用 ggarrage 组合这些图(没有风险表)

combined_works<-ggarrange(sequence$plot, histology$plot,
          labels = c("A", "B"),
          font.label = list(size = 24),
          ncol = 2, nrow = 1)

combined_works

但我无法让他们与风险表相结合

combined_doesnt_work<-ggarrange(sequence, histology,
          labels = c("A", "B"),
          font.label = list(size = 24),
          ncol = 2, nrow = 1)

combined_doesnt_work

我开始明白 ggsurvplot 的输出是一个列表,其中包括图表和表格。那个 ggarrange 想要抢劫。有没有办法将 plot 和 table 元素组合成一个 ggarange 可以让我组合的 grob?

【问题讨论】:

    标签: ggplot2 ggpubr survminer


    【解决方案1】:

    感谢Emily Zabor 帮助生成以下解决方案。

    arrange_ggsurvplots(list(sequence, histology), print = TRUE, ncol = 2, nrow = 1, risk.table.height = 0.2)
    
    

    【讨论】:

      猜你喜欢
      • 2019-12-10
      • 2013-04-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-01
      • 1970-01-01
      • 2016-10-04
      相关资源
      最近更新 更多