Last chance! 50% off unlimited learning
Sale ends in
"units"
attribute of an object.
For units.default
replaces the builtin
version, which only works for time series objects. If the variable is
also given a label
, subsetting (using [.labelled
) will
retain the "units"
attribute. For a Surv
object,
units
first looks for an overall "units"
attribute, then
it looks for units
for the time2
variable then for time1
.
units(x, ...)
"units"(x, none='', ...)
"units"(x, none='', ...)
"units"(x) <- value
units
attribute of
the tspar
attribute of x
if any; otherwise the value
none
. Handling for Surv
objects is different (see above).
label
fail.time <- c(10,20)
units(fail.time) <- "Day"
describe(fail.time)
S <- Surv(fail.time)
units(S)
label(fail.time) <- 'Failure Time'
fail.time
Run the code above in your browser using DataLab