Allows to add ggplot components - theme(), labs(), ... - to an object of class ggsurv, which is a list of ggplots.
# S3 method for ggsurv +(e1, e2) e1 %++% e2
e1 | an object of class ggsurv. |
---|---|
e2 | a plot component such as theme and labs. |
# Fit survival curves require("survival") fit<- survfit(Surv(time, status) ~ sex, data = lung) # Basic survival curves p <- ggsurvplot(fit, data = lung, risk.table = TRUE, main = "Survival curve", submain = "Based on Kaplan-Meier estimates", caption = "created with survminer" ) p