Learn R Programming

dtlg (version 0.0.2)

as_dtlg_table: Convert a TableTree to a dtlg table

Description

as_dtlg_table() reformats a TableTree object into a format close to that of dtlg's data.table.

Usage

as_dtlg_table(tt, .label_col = "stats")

Value

A data.table.

Arguments

tt

A TableTree object. Typically obtained with tern_summary_table().

.label_col

Label for stats' column.

Examples

Run this code
vars <- c('AGE', 'RACE', 'ETHNIC', 'BMRKR1')
var_labels <- c("Age (yr)", "Race", "Ethnicity", "Continuous Level Biomarker 1")

# Summary statistics table split by ARM with custom labels.
(tt <- tern_summary_table(
  adsl,
  target = vars,
  treat = 'ARM',
  target_name = var_labels
))

# Format as a dtlg table
as_dtlg_table(tt)

Run the code above in your browser using DataLab