ggsurvplot errors

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)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.