# metadata for table
t1_title <- "Cohort Summary"
t1_ds <- "ADaM Interim Dataset for Time-to-Event Analysis"
t1_fn <- "My table one footnote"
## table by treatment - without overall and render with GT
tbl_gt <-
adtte %>%
dplyr::filter(SAFFL == "Y") %>%
dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
visR::tableone(
strata = "TRTA",
overall = FALSE,
title = t1_title,
datasource = t1_ds,
footnote = t1_fn,
engine = "gt"
)
## table by treatment - without overall and render with DT
tbl_DT <-
adtte %>%
dplyr::filter(SAFFL == "Y") %>%
dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
visR::tableone(
strata = "TRTA",
overall = FALSE,
title = t1_title,
datasource = t1_ds,
footnote = t1_fn,
engine = "DT"
)
## table by treatment - without overall and render with kable
tbl_kable_html <-
adtte %>%
dplyr::filter(SAFFL == "Y") %>%
dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
visR::tableone(
strata = "TRTA",
overall = FALSE,
title = t1_title,
datasource = t1_ds,
footnote = t1_fn,
engine = "kable"
)
## table by treatment - without overall and render with kable as
## a latex table format rather than html
tbl_kable_latex <-
adtte %>%
dplyr::filter(SAFFL == "Y") %>%
dplyr::select(AGE, AGEGR1, SEX, EVNTDESC, TRTA) %>%
visR::tableone(
strata = "TRTA",
overall = FALSE,
title = t1_title,
datasource = t1_ds,
footnote = t1_fn,
output_format = "latex",
engine = "kable"
)
Run the code above in your browser using DataLab