I have the following data "dat" in counting process format with time-dependent covariates. This data means that a patient with ID=5 is observed 3 times. Using this data, I would like to draw a Kaplan-Meier curve and mark at the censoring time. I conducted the following command to draw it. As a result, the censoring is marked at three places. I think the survival curve should show only one censoring time mark per patient. How can I do this using survival package of R?
#data dat<-data.frame(ID=c(5,5,5),time1=c(0,90,120),time2=c(90,120,185),death=c(0,0,0),x=c(1,2,3)) #survival analysis library(survival) sf <- survfit(Surv(time1,time2,death)~cluster(ID),data=dat) plot(sf,mark.t=TRUE)