View source: R/tbl_continuous.R
tbl_continuous | R Documentation |
Summarize a continuous variable by one or more categorical variables
tbl_continuous(
data,
variable,
include = everything(),
digits = NULL,
by = NULL,
statistic = everything() ~ "{median} ({p25}, {p75})",
label = NULL,
value = NULL
)
data |
( |
variable |
( |
include |
( |
digits |
( |
by |
( |
statistic |
( |
label |
( |
value |
( |
a gtsummary table
# Example 1 ----------------------------------
tbl_continuous(
data = trial,
variable = age,
by = trt,
include = grade
)
# Example 2 ----------------------------------
trial |>
dplyr::mutate(all_subjects = 1) |>
tbl_continuous(
variable = age,
statistic = ~"{mean} ({sd})",
by = trt,
include = c(all_subjects, stage, grade),
value = all_subjects ~ 1,
label = list(all_subjects = "All Subjects")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.