Set global break.time.by value for ggsurvplot
Substitute manual "break.time.by" values with global which can be used by all plots.
This commit is contained in:
parent
c087b40f5c
commit
3c160c37bb
@ -17,7 +17,7 @@ surv_asct <- Surv(time = secmal$event_time_asct, event = secmal$event_status)
|
||||
sma_plot_surv_dx <- function() {
|
||||
ggsurvplot(survfit(surv_dx ~ 1), data = secmal, xscale = "d_y",
|
||||
title = "Survival after diagnosis",
|
||||
break.time.by = 5 * 365.25,
|
||||
break.time.by = sma_break.time.by,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw())
|
||||
@ -28,7 +28,7 @@ sma_plot_surv_dx_sex <- function() {
|
||||
ggsurvplot(survfit(surv_dx ~ sex, data = secmal), data = secmal,
|
||||
xscale = "d_y", title = "Survival after diagnosis",
|
||||
legend.labs = c("Female", "Male"),
|
||||
break.time.by = 5 * 365.25,
|
||||
break.time.by = sma_break.time.by,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw(),
|
||||
@ -39,7 +39,7 @@ sma_plot_surv_dx_sex <- function() {
|
||||
sma_plot_surv_asct <- function() {
|
||||
ggsurvplot(survfit(surv_asct ~ 1), data = secmal, xscale = "d_y",
|
||||
title = "Survival after transplantation",
|
||||
break.time.by = 5 * 365.25,
|
||||
break.time.by = sma_break.time.by,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw())
|
||||
@ -50,7 +50,7 @@ sma_plot_surv_asct_sex <- function() {
|
||||
ggsurvplot(survfit(surv_asct ~ sex, data = secmal), data = secmal,
|
||||
xscale = "d_y", title = "Survival after transplantation",
|
||||
legend.labs = c("Female", "Male"),
|
||||
break.time.by = 5 * 365.25,
|
||||
break.time.by = sma_break.time.by,
|
||||
surv.median.line = "hv",
|
||||
risk.table = "abs_pct",
|
||||
ggtheme = theme_bw(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user