I would like to add the label of each survival curve at the end of the lines.
I am using ggsurvplot
from the Survminer
package (which is based on ggplot2
).
I don't know how to do it with ggrepel
. I didn't find any example with survival data:
require("survival")
library(survminer)
library(ggrepel)
fit<- survfit(Surv(time, status) ~ sex, data = lung)
p=ggsurvplot(fit, data = lung)$plot;
p + geom_label_repel()
The code above throws an error.