> > identical(srv, ???(srv.char)) to return TRUE, where ??? is some unknown > function. I don't think it exists, but maybe I'm wrong. I suppose it > would be easy enough to roll my own... >
FYI, This works in my simple case for right-censored data... it takes as input a vector like c("1", "2+", "3+", "5") as.Surv <- function(x) { Surv(as.integer(sub("\\+", "", x)), as.integer(ifelse(regexpr("\\+", x) > -1, 0, 1))) } > identical(srv, as.Surv(srv.char)) [1] TRUE ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.