Hi- I am trying to run a survival analysis and then create a kaplan meier curve using the ggsurvplot function. However, when I run the code, I get the following error:
Error in data.frame(..., check.names = FALSE) :
arguments imply differing number of rows: 4, 0, 8...
Does anyone know where I may be going wrong? Thank you!!!
MRE_time <- as.numeric(c(10, 20, 15, 30))
MRE_status <- as.factor(c(1, 0, 1, 0))
MRE <- data.frame(MRE_time, MRE_status)
sfit1 <- survfit(Surv(MRE_time, MRE_status)~1, data = MRE)
ggsurvplot(sfit1, data = MRE)