tm_t_smq | R Documentation |
This module produces an adverse events table by Standardized MedDRA Query.
tm_t_smq(
label,
dataname,
parentname = ifelse(inherits(arm_var, "data_extract_spec"),
teal.transform::datanames_input(arm_var), "ADSL"),
arm_var,
id_var = teal.transform::choices_selected(teal.transform::variable_choices(dataname,
subset = "USUBJID"), selected = "USUBJID", fixed = TRUE),
llt,
add_total = TRUE,
total_label = default_total_label(),
sort_criteria = c("freq_desc", "alpha"),
drop_arm_levels = TRUE,
na_level = default_na_str(),
smq_varlabel = "Standardized MedDRA Query",
baskets,
scopes,
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_smq( ..., # 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.
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
ADAE <- tmc_ex_adae
.names_baskets <- grep("^(SMQ|CQ).*NAM$", names(ADAE), value = TRUE)
.names_scopes <- grep("^SMQ.*SC$", names(ADAE), value = TRUE)
.cs_baskets <- choices_selected(
choices = variable_choices(ADAE, subset = .names_baskets),
selected = .names_baskets
)
.cs_scopes <- choices_selected(
choices = variable_choices(ADAE, subset = .names_scopes),
selected = .names_scopes,
fixed = TRUE
)
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
app <- init(
data = data,
modules = modules(
tm_t_smq(
label = "Adverse Events by SMQ Table",
dataname = "ADAE",
arm_var = choices_selected(
choices = variable_choices(data[["ADSL"]], subset = c("ARM", "SEX")),
selected = "ARM"
),
add_total = FALSE,
baskets = data[[".cs_baskets"]],
scopes = data[[".cs_scopes"]],
llt = choices_selected(
choices = variable_choices(data[["ADAE"]], subset = c("AEDECOD")),
selected = "AEDECOD"
)
)
)
)
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.