Learn R Programming

popEpi (version 0.4.8)

as.data.table.ratetable: Coerce a ratetable Object to Class data.table

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

# S3 method for ratetable
as.data.table(x, ...)

Arguments

x

a ratetable

...

other arguments passed on to as.data.table

See Also

ratetable, as.data.frame.ratetable

Examples

Run this code
# NOT RUN {
if (requireNamespace("relsurv", quietly = TRUE)) {
  library("data.table")
  data(slopop, package = "relsurv")
  dt <- as.data.table(slopop)
  dt
}
# }

Run the code above in your browser using DataLab