tm_t_summary | R Documentation |
This module produces a table to summarize variables.
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()
)
a teal_module
object.
This module generates the following objects, which can be modified in place using decorators:
table
(TableTree
- output of rtables::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.
The TLG Catalog where additional example apps implementing this module can be found.
# 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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.