Closed mhallal1 closed 2 years ago
reproducible example
devtools::load_all("../teal")
devtools::load_all("../teal.devel")
devtools::load_all("../teal.modules.general/")
library(scda) # used to create data sets
library(dplyr) # used to modify data sets
ADSL <- synthetic_cdisc_data("latest")$adsl # nolint
ADRS <- synthetic_cdisc_data("latest")$adrs # nolint
ADLB <- synthetic_cdisc_data("latest")$adlb # nolint
app <- init(
data = cdisc_data(
cdisc_dataset("ADSL", ADSL, code = "ADSL <- synthetic_cdisc_data(\"latest\")$adsl"),
cdisc_dataset("ADRS", ADRS, code = "ADRS <- synthetic_cdisc_data(\"latest\")$adrs"),
cdisc_dataset("ADLB", ADLB, code = "ADLB <- synthetic_cdisc_data(\"latest\")$adlb"),
check = TRUE
),
modules = root_modules(
# tm_outliers ----
modules(
label = "Outliers module",
tm_outliers(
label = "Multiple long datasets",
outlier_var = list(
data_extract_spec(
dataname = "ADRS",
select = select_spec(
label = "Select variable:",
choices = variable_choices(ADRS, c("ADY", "EOSDY")),
selected = "ADY",
fixed = FALSE
)
),
data_extract_spec(
dataname = "ADLB",
select = select_spec(
label = "Select variable:",
choices = variable_choices(ADLB, c("AVAL", "CHG2")),
selected = "AVAL",
multiple = FALSE,
fixed = FALSE
)
)
),
categorical_var = list(
data_extract_spec(
dataname = "ADRS",
select = select_spec(
label = "Select variables:",
choices = variable_choices(ADRS, c("ARM", "ACTARM")),
selected = "ARM",
multiple = FALSE,
fixed = FALSE
)
),
data_extract_spec(
dataname = "ADLB",
select = select_spec(
label = "Select variables:",
choices = variable_choices(ADLB, subset = names(Filter(isTRUE, sapply(ADLB, is.factor)))),
selected = "RACE",
multiple = FALSE,
fixed = FALSE
)
)
)
)
)
)
)
runApp(app)
In the TMG vignette of
tm_outliers
, running the app breaks with the following error: