It is my first time here and I wish to as clear and kind as every user in this forum.
I am trying to generate a Kaplan-Meier Plot for Overall Survival using survival and ggplot2 packages, with the data contained in data1. OS variable codifies time variable and Exitus variable codifies the events.
The plot is generated correctly but when I used the option risk.table=TRUE, the number of patients at risk at time=0 is missing. I always used this code in order to generate Kaplan-Meier plots and I have never had this kind of problem
Any advice will be welcome
Thanks in advance!
Next, I share mi data and my code:
data1 <- data.frame("Subject"=1:46,
fit_OS<- survfit(Surv(OS, Exitus) ~ 1, data = data1)
KM_OS<-ggsurvplot(fit_OS, title="OS", legend = "bottom",
legend.title = "OS",
risk.table = TRUE,
risk.table.col = "black",
ggtheme = theme_bw(),
palette = c("#FAD234"),
tables.height = 0.15,
tables.theme = theme_cleantable(),
tables.y.text = FALSE
KM_OS$plot<-KM_OS$plot + xlab("Time (months)")