tm_t_smq {teal.modules.clinical} | R Documentation |
teal Module: Adverse Events Table by Standardized MedDRA Query
Description
This module produces an adverse events table by Standardized MedDRA Query.
Usage
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()
)
Arguments
label |
( |
dataname |
( |
parentname |
( |
arm_var |
( |
id_var |
( |
llt |
( |
add_total |
( |
total_label |
( |
sort_criteria |
( |
drop_arm_levels |
( |
na_level |
( |
smq_varlabel |
( |
baskets |
( |
scopes |
( |
pre_output |
( |
post_output |
( |
basic_table_args |
( |
Value
a teal_module
object.
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
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
)
})
datanames <- c("ADSL", "ADAE")
datanames(data) <- datanames
join_keys(data) <- default_cdisc_join_keys[datanames]
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)
}