Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ggsurv <- ggsurvplot(
fit, # survfit object with calculated statistics.
data = BRCAOV.survInfo, # data used to fit survival curves.
risk.table = TRUE, # show risk table.
pval = TRUE, # show p-value of log-rank test. = TRUE, # show confidence intervals
xlim = c(0,2000), # present narrower X axis, but not affect
# survival estimates.
xlab = "Time in days", # customize X axis label. = 500, # break X axis in time intervals by 500.
ggtheme = theme_light(), # customize plot and risk table with a theme.
risk.table.y.text.col = T,# colour risk table text annotations.
risk.table.height = 0.25, # the height of the risk table
risk.table.y.text = FALSE,# show bars instead of names in text annotations
# in legend of risk table.
ncensor.plot = TRUE, # plot the number of censored subjects at time t
ncensor.plot.height = 0.25, = "step", # customize style of confidence intervals
surv.median.line = "hv", # add the median survival pointer.
legend.labs = c("BRCA", "OV")) # change legend labels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment