tm_t_mult_events {teal.modules.clinical} | R Documentation |
teal Module: Multiple Events by Term
Description
This module produces a table of multiple events by term.
Usage
tm_t_mult_events(
label,
dataname,
parentname = ifelse(inherits(arm_var, "data_extract_spec"),
teal.transform::datanames_input(arm_var), "ADSL"),
arm_var,
seq_var,
hlt,
llt,
add_total = TRUE,
total_label = default_total_label(),
na_level = default_na_str(),
event_type = "event",
title_text = "Concomitant Medications",
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 |
( |
seq_var |
( |
hlt |
( |
llt |
( |
add_total |
( |
total_label |
( |
na_level |
( |
event_type |
( |
title_text |
( |
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_mult_events( ..., # 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
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADCM <- tmc_ex_adcm
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4")
join_keys(data)["ADCM", "ADCM"] <- adcm_keys
ADSL <- data[["ADSL"]]
ADCM <- data[["ADCM"]]
app <- init(
data = data,
modules = modules(
tm_t_mult_events(
label = "Concomitant Medications by Medication Class and Preferred Name",
dataname = "ADCM",
arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
seq_var = choices_selected("CMSEQ", selected = "CMSEQ", fixed = TRUE),
hlt = choices_selected(
choices = variable_choices(ADCM, c("ATC1", "ATC2", "ATC3", "ATC4")),
selected = c("ATC1", "ATC2", "ATC3", "ATC4")
),
llt = choices_selected(
choices = variable_choices(ADCM, c("CMDECOD")),
selected = c("CMDECOD")
),
add_total = TRUE,
event_type = "treatment"
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}