1

I have the following survival curve

require("survival")
library(survminer)
fit <- survfit(Surv(time, status) ~ 1, data = lung)
ggsurvplot(fit,  palette = "jco",risk.table = TRUE)

I would like to add to the plot the non-straight line with x time=c(0,100, 200, 300, 500, 750) and y surv=c(1, 0.99, 0.95, 0.92, 0.88, 0.82)

How can I do that?

ECII
  • 10,297
  • 18
  • 80
  • 121

1 Answers1

0

I think you're looking for the geom_curve() OR geom_segment() argument - you'll have to specify the type of curve, but it's certainly one option for adding a customized line to your ggplot.

Here's more: https://ggplot2.tidyverse.org/reference/geom_segment.html