library(survival) library(survminer) d1=data.frame(time=c(2,4,6,10),event=c(1,0,1,1)) kmc=with(d1,Surv(time,event));kmc plot(kmc) summary(kmc)