View source: R/tbl_roche_summary.R
| tbl_roche_summary | R Documentation |
This is a thin wrapper of gtsummary::tbl_summary() with the following differences:
Default summary type for continuous variables is 'continuous2'.
Number of non-missing observations, when requested, is added for each variable and placed on the row under the variable label/header.
The tbl_summary(missing*) arguments have been renamed to
tbl_roche_summary(nonmissing*) with updated default values.
The default footnotes from tbl_summary() are removed.
Cells with "0 (0.0%)" are converted to "0" with gtsummary::modify_post_fmt_fun().
tbl_roche_summary(
data,
by = NULL,
label = NULL,
statistic = list(gtsummary::all_continuous() ~ c("{mean} ({sd})", "{median}",
"{min} - {max}"), gtsummary::all_categorical() ~ "{n} ({p}%)"),
digits = NULL,
type = NULL,
value = NULL,
nonmissing = c("no", "always", "ifany"),
nonmissing_text = "n",
nonmissing_stat = "{N_nonmiss}",
sort = gtsummary::all_categorical(FALSE) ~ "alphanumeric",
percent = c("column", "row", "cell"),
include = everything()
)
data |
( |
by |
( |
label |
( |
statistic |
( |
digits |
( |
type |
( |
value |
( |
nonmissing, nonmissing_text, nonmissing_stat |
Arguments dictating how and if missing values are presented:
|
sort |
( |
percent |
( In rarer cases, you may need to define/override the typical denominators.
In these cases, pass an integer or a data frame. Refer to the
|
include |
( |
a 'gtsummary' table
# Example 1 ----------------------------------
trial |>
tbl_roche_summary(
by = trt,
include = c(age, grade),
nonmissing = "always"
) |>
add_overall()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.