Convert an object to "wide" or "long" form.
asWide(x, ...)# S3 method for ten
asWide(x, ...)
asLong(x, ...)
# S3 method for ten
asLong(x, ...)
An object of class ten
or pred
.
Additional arguments (not implemented).
A new data.table
is returned,
with the data in 'wide' or 'long' format.
There is one row for each time point.
For a ten
object generated from a numeric
or Surv
object,
this has columns:
time.
number of events.
number at risk.
# NOT RUN { data("bmt", package="KMsurv") require("survival") t1 <- ten(c1 <- coxph(Surv(t2, d3) ~ z3*z10, data=bmt)) asWide(t1) # } # NOT RUN { asLong(asWide(t1)) stopifnot(asLong(asWide(t1)) == ten(ten(t1))) # }