You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One user reported on internal forum this error. If one uses a character instead of a data.frame on the value_choices for paramcd the user gets a cryptic message Warning: Error in template_forest_tte: Assertion on 'obj_var_name' failed: Must have length 1. and the app is not usable.
This could be an issue on value_choices that needs to validate the input and provide more informative warnings/error message but I also think this should be handled here (and other arguments checked).
reproducible example
library(nestcolor)
library(dplyr)
#> #> Attaching package: 'dplyr'#> The following objects are masked from 'package:stats':#> #> filter, lag#> The following objects are masked from 'package:base':#> #> intersect, setdiff, setequal, union
library("teal.modules.clinical")
#> Loading required package: teal#> Loading required package: shiny#> Loading required package: teal.data#> Loading required package: teal.code#> Loading required package: teal.slice#> Registered S3 method overwritten by 'teal':#> method from #> c.teal_slices teal.slice#> #> You are using teal version 0.15.2.9103#> #> Attaching package: 'teal'#> The following objects are masked from 'package:teal.slice':#> #> as.teal_slices, teal_slices#> Loading required package: teal.transform#> Loading required package: tern#> Loading required package: rtables#> Loading required package: formatters#> #> Attaching package: 'formatters'#> The following object is masked from 'package:base':#> #> %||%#> Loading required package: magrittr#> #> Attaching package: 'rtables'#> The following object is masked from 'package:utils':#> #> str#> Registered S3 method overwritten by 'tern':#> method from #> tidy.glm broomdata<- teal_data()
data<- within(data, {
ADSL<-tmc_ex_adslADTTE<-tmc_ex_adtteADSL$RACE<- droplevels(ADSL$RACE) %>% with_label("Race")
})
join_keys(data) <-default_cdisc_join_keys[names(data)]
ADSL<-data[["ADSL"]]
ADTTE<-data[["ADTTE"]]
arm_ref_comp<-list(
ARM=list(
ref="B: Placebo",
comp= c("A: Drug X", "C: Combination")
),
ARMCD=list(
ref="ARM B",
comp= c("ARM A", "ARM C")
)
)
app<- init(
data=data,
modules= modules(
tm_g_forest_tte(
label="Forest Survival",
dataname="ADTTE",
arm_var= choices_selected(
variable_choices(ADSL, c("ARM", "ARMCD")),
"ARMCD"
),
arm_ref_comp=arm_ref_comp,
paramcd= choices_selected(
value_choices("ADTTE", "PARAMCD", "PARAM"),
"OS"
),
subgroup_var= choices_selected(
variable_choices(ADSL, names(ADSL)),
c("BMRKR2", "SEX")
),
strata_var= choices_selected(
variable_choices(ADSL, c("STRATA1", "STRATA2")),
"STRATA2"
)
)
)
)
#> Initializing tm_g_forest_tte#> Initializing reporter_previewer_moduleif (interactive()) {
shinyApp(app$ui, app$server)
}
Feature description
One user reported on internal forum this error. If one uses a character instead of a data.frame on the
value_choices
for paramcd the user gets a cryptic messageWarning: Error in template_forest_tte: Assertion on 'obj_var_name' failed: Must have length 1.
and the app is not usable.This could be an issue on
value_choices
that needs to validate the input and provide more informative warnings/error message but I also think this should be handled here (and other arguments checked).reproducible example
Created on 2025-01-21 with reprex v2.1.1
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: