library(dplyr)
data <- teal_data()
data <- within(data, {
ADSL <- tmc_ex_adsl
.lbls_adae <- col_labels(tmc_ex_adae)
ADAE <- tmc_ex_adae %>%
mutate_if(is.character, as.factor) #' be certain of having factors
col_labels(ADAE) <- .lbls_adae
})
join_keys(data) <- default_cdisc_join_keys[names(data)]
ADSL <- data[["ADSL"]]
ADAE <- data[["ADAE"]]
app <- init(
data = data,
modules = modules(
tm_t_events_by_grade(
label = "Adverse Events by Grade Table",
dataname = "ADAE",
arm_var = choices_selected(c("ARM", "ARMCD"), "ARM"),
llt = choices_selected(
choices = variable_choices(ADAE, c("AETERM", "AEDECOD")),
selected = c("AEDECOD")
),
hlt = choices_selected(
choices = variable_choices(ADAE, c("AEBODSYS", "AESOC")),
selected = "AEBODSYS"
),
grade = choices_selected(
choices = variable_choices(ADAE, c("AETOXGR", "AESEV")),
selected = "AETOXGR"
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
Run the code above in your browser using DataLab