diff --git a/secmal.R b/secmal.R index 0b82288..389693c 100644 --- a/secmal.R +++ b/secmal.R @@ -80,7 +80,7 @@ sma_plot_secmal_cmprsk <- function() { cpr <- cuminc(secmal$time_at_risk / 365.25, secmal$time_at_risk_status) ggcompetingrisks(cpr[1], conf.int = TRUE, multiple_panels = FALSE, legend = "none", title = "", ylim = c(0:1), - xlab = "Years") + xlab = "Years", ggtheme = theme_bw(), palette = "lancet") } # Calculate cumuative risk with ci from cuminc. diff --git a/survival.R b/survival.R index c81a560..233d688 100644 --- a/survival.R +++ b/survival.R @@ -40,6 +40,7 @@ sma_plot_surv_asct <- function() { risk.table = "abs_pct", legend = "none", xlab = "Years", + palette = "lancet", ggtheme = theme_bw()) } @@ -80,6 +81,7 @@ sma_plot_surv_sm <- function() { break.time.by = 365.25, legend = "none", xlab = "Years", + palette = "lancet", ggtheme = theme_bw()) } diff --git a/utils.R b/utils.R index 1658360..fc90d3c 100644 --- a/utils.R +++ b/utils.R @@ -7,6 +7,7 @@ library(survival) library(survminer) library(tidyverse) library(cmprsk) +library(ggsci) # # Write plot to filename diff --git a/visualize.R b/visualize.R index ca7ab38..939853c 100644 --- a/visualize.R +++ b/visualize.R @@ -70,7 +70,10 @@ sma_jitt_dx_year <- function() { ggplot(data, aes(x = asct_year, y = dx, colour = dx, fill = dx)) + geom_jitter(width = 0.4, height = 0.2) + labs(x = "Year", y = "Diagnosis") + + theme_bw() + theme(legend.position = "none") + + scale_color_lancet() + + scale_fill_lancet() + xlim(1990, 2020) }