add_overall_ard | R Documentation |
Adds a column with overall summary statistics to tables
created by tbl_ard_summary()
.
## S3 method for class 'tbl_ard_summary'
add_overall(
x,
cards,
last = FALSE,
col_label = "**Overall**",
statistic = NULL,
...
)
x |
( |
cards |
( |
last |
(scalar |
col_label |
( |
statistic |
( |
... |
These dots are for future extensions and must be empty. |
A gtsummary
of same class as x
Daniel D. Sjoberg
# Example 1 ----------------------------------
# build primary table
tbl <-
cards::ard_stack(
trial,
.by = trt,
cards::ard_continuous(variables = age),
cards::ard_categorical(variables = grade),
.missing = TRUE,
.attributes = TRUE,
.total_n = TRUE
) |>
tbl_ard_summary(by = trt)
# create ARD with overall results
ard_overall <-
cards::ard_stack(
trial,
cards::ard_continuous(variables = age),
cards::ard_categorical(variables = grade),
.missing = TRUE,
.attributes = TRUE,
.total_n = TRUE
)
# add an overall column
tbl |>
add_overall(cards = ard_overall)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.