tm_t_summary {teal.modules.clinical} | R Documentation |
teal Module: Summary of Variables
Description
This module produces a table to summarize variables.
Usage
tm_t_summary(
label,
dataname,
parentname = ifelse(inherits(arm_var, "data_extract_spec"),
teal.transform::datanames_input(arm_var), "ADSL"),
arm_var,
summarize_vars,
add_total = TRUE,
total_label = default_total_label(),
show_arm_var_labels = TRUE,
useNA = c("ifany", "no"),
na_level = default_na_str(),
numeric_stats = c("n", "mean_sd", "mean_ci", "median", "median_ci", "quantiles",
"range", "geom_mean"),
denominator = c("N", "n", "omit"),
drop_arm_levels = TRUE,
pre_output = NULL,
post_output = NULL,
basic_table_args = teal.widgets::basic_table_args(),
transformators = list(),
decorators = list()
)
Arguments
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
summarize_vars |
( |
add_total |
( |
total_label |
( |
show_arm_var_labels |
( |
useNA |
( |
na_level |
( |
numeric_stats |
( |
denominator |
( |
drop_arm_levels |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
transformators |
( |
decorators |
See section "Decorating Module" below for more details. |
Value
a teal_module
object.
Decorating Module
This module generates the following objects, which can be modified in place using decorators:
-
table
(TableTree
- output ofrtables::build_table()
)
A Decorator is applied to the specific output using a named list of teal_transform_module
objects.
The name of this list corresponds to the name of the output to which the decorator is applied.
See code snippet below:
tm_t_summary( ..., # arguments for module decorators = list( table = teal_transform_module(...) # applied only to `table` output ) )
For additional details and examples of decorators, refer to the vignette
vignette("decorate-module-output", package = "teal.modules.clinical")
.
To learn more please refer to the vignette
vignette("transform-module-output", package = "teal")
or the teal::teal_transform_module()
documentation.
Examples in Shinylive
- example-1
See Also
The TLG Catalog where additional example apps implementing this module can be found.
Examples
# Preparation of the test case - use `EOSDY` and `DCSREAS` variables to demonstrate missing data.
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADSL$EOSDY[1] <- NA_integer_
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
app <- init(
data = data,
modules = modules(
tm_t_summary(
label = "Demographic Table",
dataname = "ADSL",
arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
add_total = TRUE,
summarize_vars = choices_selected(
c("SEX", "RACE", "BMRKR2", "EOSDY", "DCSREAS", "AGE"),
c("SEX", "RACE")
),
useNA = "ifany"
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}