Coerce a ratetable Object to Class data.table

Share:

Description

ratatable objects used in e.g. survival and relsurv can be conveniently coerced to a long-format data.frame. However, the names and levels of variables in the result may not match names and levels of variables in your data.

Usage

1
2
## S3 method for class 'ratetable'
as.data.table(x, ...)

Arguments

x

a ratetable

...

other arguments passed on to as.data.table

Author(s)

Joonas Miettinen

See Also

ratetable, as.data.frame.ratetable

Examples

1
2
3
4
5
6
if (requireNamespace("relsurv", quietly = TRUE)) {
  library("data.table")
  data(slopop, package = "relsurv")
  dt <- as.data.table(slopop)
  dt
}

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.