The following example is modified from document example by adding "age"
d.coxph <- (survfit(Surv(time, status) ~ sex+age, data = lung))
autoplot(d.coxph)
I'll get the following error:
Error in
levels<-
(*tmp*
, value = if (nl == nL) as.character(labels) else paste0(labels, : factor level [41] is duplicatedEnter a frame number, or 0 to exit
1: autoplot(d.coxph)> Error in
levels<-
(*tmp*
, value = if (nl == nL) as.character(labels) else paste0(labels, : factor level [41] is duplicatedEnter a frame number, or 0 to exit
1: autoplot(d.coxph) 2: autoplot.survfit(d.coxph) 3: fortify(object, surv.connect = surv.connect, fun = fun) 4: fortify.survfit(object, surv.connect = surv.connect, fun = fun) 5: factor(rep(groupIDs, model$strata), levels = groupIDs)
2: autoplot.survfit(d.coxph) 3: fortify(object, surv.connect = surv.connect, fun = fun) 4: fortify.survfit(object, surv.connect = surv.connect, fun = fun) 5: factor(rep(groupIDs, model$strata), levels = groupIDs)
plot(d.coxph)
and after minimal testing, it doesn't seem likeautoplot
supports a survfit formula with two variables on the right – rawr