I'm trying to plot an adjusted survival curve, but struggling with changing the line types by group. I'm able to customise other aspects of the plot using typical ggplot2 language, but I've hit a wall with changing line type.
Example:
library(survival)
library(survminer)
fit2 <- coxph( Surv(stop, event) ~ size + strata(rx), data = bladder )
ggadjustedcurves(fit2,
variable = "rx",
data = bladder,
method = "average",
palette = c("#E69F00", "#56B4E9"),
size = 1.3,
legend = "right",
legend.title = expression(bold("Legend title")),
xlab = "Time",
font.legend = 12) +
theme(legend.text.align = 0.5)
I've tried adding in:
geom_line( aes( linetype = c(1, 2) )
add.params = list(linetype = c(1, 2))
and just
linetype = c(1, 2)
but nothing seems to work.