Closed saerobson closed 2 months ago
✅ All contributors have signed the CLA
Posted by the CLA Assistant Lite bot.
I have read the CLA Document and I hereby sign the CLA
@saerobson Thanks for providing a video on the problem. Can I also ask for the code that you use so I can reproduce the issue?
Please find the code below to create the broken app video.
# library
library(shiny)
library(teal)
library(teal.widgets)
library(teal.modules.general)
library(teal.logger)
# global variables
ggplot_themes <- c("gray", "bw", "linedraw", "light", "dark", "minimal", "classic", "void")
interactive <- NULL
# CDISC data example
data <- teal_data()
data <- within(data, {
ADSL <- rADSL
ADVS <- rADVS
})
datanames(data) <- c("ADSL", "ADVS")
join_keys(data) <- default_cdisc_join_keys[datanames(data)]
vars1 <- choices_selected(
variable_choices(data[["ADSL"]], c("ARM", "COUNTRY", "SEX")),
selected = NULL
)
# data_extract_specs
dist_var_adsl = data_extract_spec(
dataname = "ADSL",
select = select_spec(
choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")),
selected = "BMRKR1",
multiple = FALSE,
fixed = FALSE
)
)
dist_var_advs = data_extract_spec(
dataname = "ADVS",
select = select_spec(
choices = variable_choices(data[["ADVS"]], c("AVAL")),
selected = "AVAL",
multiple = FALSE,
fixed = FALSE
)
)
# app
app <- init(
data = data,
modules = modules(
tm_g_distribution(
dist_var = list(dist_var_adsl,
dist_var_advs
),
strata_var = data_extract_spec(
dataname = "ADSL",
filter = filter_spec(
vars = vars1,
multiple = TRUE
)
),
group_var = data_extract_spec(
dataname = "ADSL",
filter = filter_spec(
vars = vars1,
multiple = TRUE
)
),
ggplot2_args = ggplot2_args(
labs = list(subtitle = "Plot generated by Distribution Module")
)
)
)
)
if (interactive()) {
shinyApp(app$ui, app$server)
}
@gogonzo Please help us with the review:)
Thanks @saerobson
I have made a direct PR as it was recommended for such small updates. Fix distribution default parameters when multiple data_extract_spec's are specified. Documentation states that multiple data_extract_spec’s can be specified so this solution makes this work.
Problem: https://github.com/user-attachments/assets/08e0a0b6-3e26-4d2b-97c7-82c9feaa0ad0
Solution: https://github.com/user-attachments/assets/b9cd2122-4cb6-4913-90cb-bb67c185693e