insightsengineering / teal.modules.clinical

Provides teal modules for the standard clinical trials outputs
https://insightsengineering.github.io/teal.modules.clinical/
Other
32 stars 17 forks source link

[Bug]: <title>Error: object 'validate_standard_inputs' not found #730

Closed kaipingyang closed 1 year ago

kaipingyang commented 1 year ago

What happened?

Error: object 'validate_standard_inputs' not found

Most modules usevalidate_standard_inputs to check variables,such as

validate_standard_inputs(
  adsl = adsl_filtered,
  adslvars = c("USUBJID", "STUDYID", input_arm_var),
  anl = anl_filtered,
  anlvars = c("USUBJID", "STUDYID", input_summarize_vars),
  arm_var = input_arm_var[[1]]
)

In teal.modules.clinical version 0.8.14.9021 we can query the help(validate_standard_inputs) for the validate_standard_inputs function, but

  1. The validate_standard_inputs object is not found when we enter validate_standard_inputs image

  2. When running the example given in the validate_standard_inputs help, an error appears on the shiny app because the validate_standard_inputs object is not found:

    
    library(teal)
    library(teal.modules.clinical)
    library(shiny)

ADSL <- tmc_ex_adsl ADAE <- tmc_ex_adae

ui <- fluidPage( shiny::sliderInput("obs", "Max Age", min = 0, max = 100, value = 100 ), shiny::sliderInput("maxgr", "Max Grade", min = 0, max = 5, value = 5 ), plotOutput("plot") )

server <- function(input, output) { output$plot <- renderPlot({ keep_adsl <- c("USUBJID", "STUDYID", "ARMCD", "AGE", "ARM") keep_adae <- c("USUBJID", "STUDYID", "AETOXGR")

ADSL_f <- ADSL[ADSL$AGE <= input$obs, keep_adsl]
ADAE_f <- ADAE[as.numeric(ADAE$AETOXGR) <= input$maxgr, keep_adae]

validate_standard_inputs(
  adsl = ADSL_f,
  adslvars = keep_adsl,
  anl = ADAE_f,
  anlvars = keep_adae,
  arm_var = "ARM",
  need_arm = TRUE
)

ANL <- merge(ADSL_f, ADAE_f, by = c("USUBJID", "STUDYID"))

plot(ANL$AGE, jitter(as.numeric(ANL$AETOXGR)), xlab = "AGE", ylab = "AETOXGR")

}) } if (interactive()) { shinyApp(ui, server) }

![image](https://user-images.githubusercontent.com/55199277/221089363-6ad002f6-805e-4a07-b009-5d255e67bc79.png)

### sessionInfo()

```R
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS:   /opt/R/R_4.1.2/lib64/R/lib/libRblas.so
LAPACK: /opt/R/R_4.1.2/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] scda.2022_0.1.3.9016              teal.modules.clinical_0.8.14.9021 tern_0.7.10                      
 [4] rtables_0.5.3.4                   formatters_0.3.4.19               teal.modules.general_0.2.15      
 [7] shinyTree_0.2.7                   ggmosaic_0.3.3                    teal.widgets_0.2.0.9022          
[10] teal.slice_0.2.0.9023             teal.reporter_0.1.1               teal.logger_0.1.1.9004           
[13] teal.code_0.3.0                   teal_0.12.0.9022                  teal.transform_0.2.0.9011        
[16] magrittr_2.0.3                    teal.data_0.1.2.9013              shiny_1.7.4                      
[19] nestcolor_0.0.1                   scda_0.1.5.9007                   forcats_1.0.0                    
[22] stringr_1.5.0                     dplyr_1.1.0                       purrr_1.0.1                      
[25] readr_2.1.4                       tidyr_1.3.0                       tibble_3.1.8                     
[28] ggplot2_3.4.1                     tidyverse_1.3.2                  

loaded via a namespace (and not attached):
  [1] readxl_1.4.1        backports_1.4.1     lazyeval_0.2.2      splines_4.1.2       usethis_2.1.6      
  [6] tern.gee_0.1.0      digest_0.6.31       htmltools_0.5.4     rsconnect_0.8.27    fansi_1.0.4        
 [11] checkmate_2.1.0     memoise_2.0.1       googlesheets4_1.0.1 tzdb_0.3.0          remotes_2.4.2      
 [16] modelr_0.1.9        R.utils_2.12.2      prettyunits_1.1.1   colorspace_2.1-0    rvest_1.0.3        
 [21] ggrepel_0.9.3       haven_2.5.1         rbibutils_2.2.9     xfun_0.37           callr_3.7.3        
 [26] crayon_1.5.2        jsonlite_1.8.4      survival_3.2-13     glue_1.6.2          geepack_1.3.9      
 [31] gtable_0.3.1        gargle_1.2.1        emmeans_1.8.4-1     R.cache_0.16.0      pkgbuild_1.3.1     
 [36] scales_1.2.1        mvtnorm_1.1-3       DBI_1.1.3           miniUI_0.1.1.1      Rcpp_1.0.10        
 [41] viridisLite_0.4.1   xtable_1.8-4        profvis_0.3.7       htmlwidgets_1.6.1   httr_1.4.4         
 [46] ellipsis_0.3.2      urlchecker_1.0.1    pkgconfig_2.0.3     R.methodsS3_1.8.2   sass_0.4.5         
 [51] dbplyr_2.2.1        utf8_1.2.3          tidyselect_1.2.0    rlang_1.0.6         later_1.3.0        
 [56] munsell_0.5.0       cellranger_1.1.0    tools_4.1.2         cachem_1.0.6        cli_3.6.0          
 [61] generics_0.1.3      devtools_2.4.4      broom_1.0.3         evaluate_0.20       fastmap_1.1.0      
 [66] yaml_2.3.7          processx_3.8.0      knitr_1.42          fs_1.6.1            nlme_3.1-153       
 [71] mime_0.12           R.oo_1.25.0         xml2_1.3.3          compiler_4.1.2      rstudioapi_0.14    
 [76] curl_5.0.0          plotly_4.10.1       reprex_2.0.2        bslib_0.4.2         stringi_1.7.12     
 [81] ps_1.7.2            logger_0.2.2        lattice_0.20-45     Matrix_1.5-1        styler_1.9.0       
 [86] shinyjs_2.1.0       vctrs_0.5.2         pillar_1.8.1        lifecycle_1.0.3     BiocManager_1.30.18
 [91] Rdpack_2.4          jquerylib_0.1.4     estimability_1.4.1  data.table_1.14.6   httpuv_1.6.9       
 [96] R6_2.5.1            promises_1.2.0.1    sessioninfo_1.2.2   MASS_7.3-54         assertthat_0.2.1   
[101] pkgload_1.3.2       fontawesome_0.5.0   rprojroot_2.0.3     shinyWidgets_0.7.6  withr_2.5.0        
[106] hms_1.1.2           shinyvalidate_0.1.2 grid_4.1.2          rmarkdown_2.20      googledrive_2.0.0  
[111] lubridate_1.8.0

Relevant log output

Error: object 'validate_standard_inputs' not found

Error: could not find function "validate_standard_inputs"

Code of Conduct

Contribution Guidelines

Security Policy

mhallal1 commented 1 year ago

This case is not reproducible on my machine, validate_standard_inputs is still a valid function in teal.modules.clinical. @chlebowa @BLAZEWIM can you guys test this out?

BLAZEWIM commented 1 year ago

This case is not reproducible on my machine, validate_standard_inputs is still a valid function in teal.modules.clinical. @chlebowa @BLAZEWIM can you guys test this out?

Also cannot replicate, function is found and app works. teal.modules.clinical_0.8.14.9021

mhallal1 commented 1 year ago

@kaipingyang could you start with a new session and load teal.modules.clinical and test again please?

kaipingyang commented 1 year ago

@kaipingyang could you start with a new session and load teal.modules.clinical and test again please? I manage stable and development versions of the teal family on linux and windows by renv in R project . At present, all questions about validate_standard_inputs are Error: object 'validate_standard_inputs' not found

1.linux system install development version of teal: The result is as above

  1. Linux system install https://github.com/insightsengineering/depository 2022 _10_13 release version:
> validate_standard_inputs
Error: object 'validate_standard_inputs' not found
> ls("package:teal.modules.clinical")
 [1] "add_expr"                        "bracket_expr"                    "call_concatenate"               
 [4] "clean_description"               "color_lab_values"                "column_annotation_label"        
 [7] "cs_to_des_filter"                "cs_to_des_select"                "cs_to_filter_spec"              
[10] "cs_to_select_spec"               "extract_input"                   "get_var_labels"                 
[13] "h_concat_expr"                   "is.cs_or_des"                    "pipe_expr"                      
[16] "prepare_arm"                     "prepare_arm_levels"              "split_choices"                  
[19] "split_col_expr"                  "split_interactions"              "styled_expr"                    
[22] "teal_enough_rows"                "teal_has_element"                "tm_a_mmrm"                      
[25] "tm_g_barchart_simple"            "tm_g_ci"                         "tm_g_forest_rsp"                
[28] "tm_g_forest_tte"                 "tm_g_ipp"                        "tm_g_km"                        
[31] "tm_g_lineplot"                   "tm_g_pp_adverse_events"          "tm_g_pp_patient_timeline"       
[34] "tm_g_pp_therapy"                 "tm_g_pp_vitals"                  "tm_t_abnormality"               
[37] "tm_t_abnormality_by_worst_grade" "tm_t_ancova"                     "tm_t_binary_outcome"            
[40] "tm_t_coxreg"                     "tm_t_events"                     "tm_t_events_by_grade"           
[43] "tm_t_events_patyear"             "tm_t_events_summary"             "tm_t_exposure"                  
[46] "tm_t_logistic"                   "tm_t_mult_events"                "tm_t_pp_basic_info"             
[49] "tm_t_pp_laboratory"              "tm_t_pp_medical_history"         "tm_t_pp_prior_medication"       
[52] "tm_t_shift_by_arm"               "tm_t_shift_by_arm_by_worst"      "tm_t_shift_by_grade"            
[55] "tm_t_smq"                        "tm_t_summary"                    "tm_t_summary_by"                
[58] "tm_t_tte"                       
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS:   /opt/R/R_4.1.2/lib64/R/lib/libRblas.so
LAPACK: /opt/R/R_4.1.2/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] teal.modules.clinical_0.8.14 tern_0.7.10                  rtables_0.5.3               
[4] formatters_0.3.4             teal_0.12.0                  teal.transform_0.2.0        
[7] magrittr_2.0.3               teal.data_0.1.2              shiny_1.7.3                 

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9          lattice_0.20-45     tidyr_1.2.1         assertthat_0.2.1    digest_0.6.30      
 [6] utf8_1.2.2          mime_0.12           R6_2.5.1            backports_1.4.1     evaluate_0.18      
[11] ggplot2_3.4.0       pillar_1.8.1        Rdpack_2.4          rlang_1.0.6         rstudioapi_0.14    
[16] R.utils_2.12.1      R.oo_1.25.0         Matrix_1.5-1        shinyvalidate_0.1.2 teal.code_0.2.0    
[21] checkmate_2.1.0     rmarkdown_2.17      teal.reporter_0.1.1 styler_1.8.1        splines_4.1.2      
[26] shinyjs_2.1.0       munsell_0.5.0       broom_1.0.1         compiler_4.1.2      httpuv_1.6.6       
[31] xfun_0.37           pkgconfig_2.0.3     htmltools_0.5.3     tidyselect_1.2.0    tibble_3.1.8       
[36] teal.logger_0.1.1   fansi_1.0.3         dplyr_1.0.10        later_1.3.0         rbibutils_2.2.9    
[41] teal.widgets_0.2.0  R.methodsS3_1.8.2   grid_4.1.2          xtable_1.8-4        gtable_0.3.1       
[46] lifecycle_1.0.3     DBI_1.1.3           scales_1.2.1        cli_3.4.1           renv_0.16.0        
[51] promises_1.2.0.1    logger_0.2.2        ellipsis_0.3.2      vctrs_0.5.0         generics_0.1.3     
[56] tools_4.1.2         R.cache_0.16.0      glue_1.6.2          purrr_0.3.5         fastmap_1.1.0      
[61] survival_3.2-13     yaml_2.3.6          colorspace_2.0-3    knitr_1.40

3.Windows system install development version of teal:

> validate_standard_inputs
Error: object 'validate_standard_inputs' not found
> ls("package:teal.modules.clinical")
 [1] "add_expr"                        "bracket_expr"                    "call_concatenate"               
 [4] "clean_description"               "color_lab_values"                "column_annotation_label"        
 [7] "cs_to_des_filter"                "cs_to_des_select"                "cs_to_filter_spec"              
[10] "cs_to_select_spec"               "extract_input"                   "get_var_labels"                 
[13] "h_concat_expr"                   "is.cs_or_des"                    "pipe_expr"                      
[16] "prepare_arm"                     "prepare_arm_levels"              "split_choices"                  
[19] "split_col_expr"                  "split_interactions"              "styled_expr"                    
[22] "teal_enough_rows"                "teal_has_element"                "tm_a_gee"                       
[25] "tm_a_mmrm"                       "tm_g_barchart_simple"            "tm_g_ci"                        
[28] "tm_g_forest_rsp"                 "tm_g_forest_tte"                 "tm_g_ipp"                       
[31] "tm_g_km"                         "tm_g_lineplot"                   "tm_g_pp_adverse_events"         
[34] "tm_g_pp_patient_timeline"        "tm_g_pp_therapy"                 "tm_g_pp_vitals"                 
[37] "tm_t_abnormality"                "tm_t_abnormality_by_worst_grade" "tm_t_ancova"                    
[40] "tm_t_binary_outcome"             "tm_t_coxreg"                     "tm_t_events"                    
[43] "tm_t_events_by_grade"            "tm_t_events_patyear"             "tm_t_events_summary"            
[46] "tm_t_exposure"                   "tm_t_logistic"                   "tm_t_mult_events"               
[49] "tm_t_pp_basic_info"              "tm_t_pp_laboratory"              "tm_t_pp_medical_history"        
[52] "tm_t_pp_prior_medication"        "tm_t_shift_by_arm"               "tm_t_shift_by_arm_by_worst"     
[55] "tm_t_shift_by_grade"             "tm_t_smq"                        "tm_t_summary"                   
[58] "tm_t_summary_by"                 "tm_t_tte"                        "tmc_ex_adae"                    
[61] "tmc_ex_adcm"                     "tmc_ex_adlb"                     "tmc_ex_adrs"                    
[64] "tmc_ex_adsl"                     "tmc_ex_adtte"                   
> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8  LC_CTYPE=Chinese (Simplified)_China.utf8   
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C                               
[5] LC_TIME=Chinese (Simplified)_China.utf8    

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] teal.code_0.3.0.9001              teal.widgets_0.2.0.9024           teal.modules.clinical_0.8.14.9021
 [4] tern_0.7.10.9050                  rtables_0.5.3.4                   formatters_0.3.4.20              
 [7] teal.modules.general_0.2.15.9017  shinyTree_0.2.7                   ggmosaic_0.3.3                   
[10] teal_0.12.0.9023                  teal.transform_0.2.0.9011         magrittr_2.0.3                   
[13] teal.data_0.1.2.9013              shiny_1.7.4                       nestcolor_0.1.0                  
[16] scda_0.1.5                        forcats_1.0.0                     stringr_1.5.0                    
[19] dplyr_1.1.0                       purrr_1.0.1                       readr_2.1.4                      
[22] tidyr_1.3.0                       tibble_3.1.8                      ggplot2_3.4.1                    
[25] tidyverse_1.3.2                  

loaded via a namespace (and not attached):
  [1] googledrive_2.0.0        colorspace_2.1-0         ellipsis_0.3.2           estimability_1.4.1      
  [5] fs_1.6.0                 rstudioapi_0.14          remotes_2.4.2            ggrepel_0.9.3           
  [9] mvtnorm_1.1-3            fansi_1.0.4              lubridate_1.9.0          xml2_1.3.3              
 [13] splines_4.2.1            R.methodsS3_1.8.2        cachem_1.0.6             knitr_1.42              
 [17] pkgload_1.3.2            jsonlite_1.8.4           broom_1.0.3              dbplyr_2.2.1            
 [21] geepack_1.3.9            R.oo_1.25.0              BiocManager_1.30.19      compiler_4.2.1          
 [25] httr_1.4.4               emmeans_1.8.4-1          backports_1.4.1          Matrix_1.5-3            
 [29] assertthat_0.2.1         fastmap_1.1.0            lazyeval_0.2.2           gargle_1.2.1            
 [33] cli_3.6.0                later_1.3.0              htmltools_0.5.4          prettyunits_1.1.1       
 [37] tools_4.2.1              gtable_0.3.1             glue_1.6.2               Rcpp_1.0.10             
 [41] cellranger_1.1.0         jquerylib_0.1.4          styler_1.9.0             vctrs_0.5.2             
 [45] nlme_3.1-157             teal.logger_0.1.1.9004   xfun_0.37                rbibutils_2.2.13        
 [49] ps_1.7.2                 rvest_1.0.3              timechange_0.1.1         mime_0.12               
 [53] miniUI_0.1.1.1           lifecycle_1.0.3          shinyvalidate_0.1.2      renv_0.16.0             
 [57] devtools_2.4.5           googlesheets4_1.0.1      MASS_7.3-57              scales_1.2.1            
 [61] hms_1.1.2                promises_1.2.0.1         tern.gee_0.1.0.9002      yaml_2.3.7              
 [65] memoise_2.0.1            teal.slice_0.2.0.9024    sass_0.4.5               stringi_1.7.12          
 [69] checkmate_2.1.0          teal.reporter_0.1.1.9013 pkgbuild_1.4.0           Rdpack_2.4              
 [73] rlang_1.0.6              pkgconfig_2.0.3          lattice_0.20-45          evaluate_0.20           
 [77] htmlwidgets_1.6.1        processx_3.8.0           tidyselect_1.2.0         logger_0.2.2            
 [81] R6_2.5.1                 generics_0.1.3           profvis_0.3.7            DBI_1.1.3               
 [85] pillar_1.8.1             haven_2.5.1              withr_2.5.0              survival_3.3-1          
 [89] modelr_0.1.10            crayon_1.5.2             shinyWidgets_0.7.6       utf8_1.2.2              
 [93] plotly_4.10.1            tzdb_0.3.0               rmarkdown_2.20           urlchecker_1.0.1        
 [97] usethis_2.1.6            grid_4.2.1               readxl_1.4.1             data.table_1.14.8       
[101] callr_3.7.3              reprex_2.0.2             digest_0.6.31            xtable_1.8-4            
[105] R.cache_0.16.0           httpuv_1.6.8             R.utils_2.12.2           munsell_0.5.0           
[109] viridisLite_0.4.1        bslib_0.4.2              sessioninfo_1.2.2        shinyjs_2.1.0   

4.Windows system install https://github.com/insightsengineering/depository 2022 _10_13 release version:

> validate_standard_inputs
Error: object 'validate_standard_inputs' not found
> ls("package:teal.modules.clinical")
 [1] "add_expr"                        "bracket_expr"                    "call_concatenate"               
 [4] "clean_description"               "color_lab_values"                "column_annotation_label"        
 [7] "cs_to_des_filter"                "cs_to_des_select"                "cs_to_filter_spec"              
[10] "cs_to_select_spec"               "extract_input"                   "get_var_labels"                 
[13] "h_concat_expr"                   "is.cs_or_des"                    "pipe_expr"                      
[16] "prepare_arm"                     "prepare_arm_levels"              "split_choices"                  
[19] "split_col_expr"                  "split_interactions"              "styled_expr"                    
[22] "teal_enough_rows"                "teal_has_element"                "tm_a_mmrm"                      
[25] "tm_g_barchart_simple"            "tm_g_ci"                         "tm_g_forest_rsp"                
[28] "tm_g_forest_tte"                 "tm_g_ipp"                        "tm_g_km"                        
[31] "tm_g_lineplot"                   "tm_g_pp_adverse_events"          "tm_g_pp_patient_timeline"       
[34] "tm_g_pp_therapy"                 "tm_g_pp_vitals"                  "tm_t_abnormality"               
[37] "tm_t_abnormality_by_worst_grade" "tm_t_ancova"                     "tm_t_binary_outcome"            
[40] "tm_t_coxreg"                     "tm_t_events"                     "tm_t_events_by_grade"           
[43] "tm_t_events_patyear"             "tm_t_events_summary"             "tm_t_exposure"                  
[46] "tm_t_logistic"                   "tm_t_mult_events"                "tm_t_pp_basic_info"             
[49] "tm_t_pp_laboratory"              "tm_t_pp_medical_history"         "tm_t_pp_prior_medication"       
[52] "tm_t_shift_by_arm"               "tm_t_shift_by_arm_by_worst"      "tm_t_shift_by_grade"            
[55] "tm_t_smq"                        "tm_t_summary"                    "tm_t_summary_by"                
[58] "tm_t_tte"                       
> sessionInfo()
R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.utf8  LC_CTYPE=Chinese (Simplified)_China.utf8   
[3] LC_MONETARY=Chinese (Simplified)_China.utf8 LC_NUMERIC=C                               
[5] LC_TIME=Chinese (Simplified)_China.utf8    

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
 [1] teal.widgets_0.2.0           teal.slice_0.2.0             teal.reporter_0.1.1         
 [4] teal.logger_0.1.1            teal.code_0.2.0              teal.modules.clinical_0.8.14
 [7] tern_0.7.10                  rtables_0.5.3                formatters_0.3.4            
[10] teal.modules.general_0.2.15  shinyTree_0.2.7              ggmosaic_0.3.3              
[13] ggplot2_3.4.1                teal_0.12.0                  teal.transform_0.2.0        
[16] magrittr_2.0.3               teal.data_0.1.2              shiny_1.7.4                 

loaded via a namespace (and not attached):
 [1] httr_1.4.5         sass_0.4.5         tidyr_1.3.0        jsonlite_1.8.4     viridisLite_0.4.1 
 [6] splines_4.2.1      R.utils_2.12.2     bslib_0.4.2        Rdpack_2.4         assertthat_0.2.1  
[11] renv_0.16.0        yaml_2.3.7         ggrepel_0.9.3      pillar_1.8.1       backports_1.4.1   
[16] lattice_0.20-45    glue_1.6.2         digest_0.6.31      promises_1.2.0.1   rbibutils_2.2.13  
[21] checkmate_2.1.0    colorspace_2.1-0   htmltools_0.5.4    httpuv_1.6.9       Matrix_1.5-3      
[26] R.oo_1.25.0        pkgconfig_2.0.3    broom_1.0.3        logger_0.2.2       purrr_1.0.1       
[31] xtable_1.8-4       scales_1.2.1       later_1.3.0        tibble_3.1.8       styler_1.9.0      
[36] generics_0.1.3     ellipsis_0.3.2     cachem_1.0.7       withr_2.5.0        shinyjs_2.1.0     
[41] lazyeval_0.2.2     cli_3.6.0          survival_3.3-1     mime_0.12          evaluate_0.20     
[46] R.methodsS3_1.8.2  fansi_1.0.4        R.cache_0.16.0     tools_4.2.1        data.table_1.14.8 
[51] lifecycle_1.0.3    stringr_1.5.0      plotly_4.10.1      munsell_0.5.0      jquerylib_0.1.4   
[56] compiler_4.2.1     rlang_1.0.6        grid_4.2.1         htmlwidgets_1.6.1  shinyWidgets_0.7.6
[61] rmarkdown_2.20     gtable_0.3.1       R6_2.5.1           knitr_1.42         dplyr_1.1.0       
[66] fastmap_1.1.1      utf8_1.2.3         stringi_1.7.12     Rcpp_1.0.10        vctrs_0.5.2       
[71] xfun_0.37          tidyselect_1.2.0
kaipingyang commented 1 year ago

@mhallal1 The bug should be caused by the absence of export(validate_standard_inputs) in the NAMESPACE file.

Thus the validate_standard_inputs function cannot be found in the teal.modules.clinical namespace: image

Please check the document at https://github.com/insightsengineering/teal.modules.clinical/blob/main/NAMESPACE image

mhallal1 commented 1 year ago

@kaipingyang the function validate_standard_inputs is meant to be internal to be used by module developers only, if required otherwise for your usage, we can export the function.

chlebowa commented 1 year ago

Sorry to be late to the party, I thought the lack of reproduction by @BLAZEWIM was conclusive.

@mhallal1 is correct, this is an internal function. @kaipingyang, did your problem occur when you were using a module or creating one?

kaipingyang commented 1 year ago

@kaipingyang the function validate_standard_inputs is meant to be internal to be used by module developers only, if required otherwise for your usage, we can export the function. I want to use validate_standard_inputs as module developer, which would be nice if exported.

Sorry to be late to the party, I thought the lack of reproduction by @BLAZEWIM was conclusive.

@mhallal1 is correct, this is an internal function. @kaipingyang, did your problem occur when you were using a module or creating one? I am creating a custom teal module using the tm_t_summary source code as a template, so I find that as the developer of the custom module cannot use validate_standard_inputs for validation, I have to comment out the code for validate_standard_inputs to ensure proper use of the custom teal module. The shiny validation process has helped me a lot in learning to create custom teal modules, so I'd like to use validate_standard_inputs if possible.

chlebowa commented 1 year ago

If you run devtools::load_all() in the top directory of your repository (teal.modules.clinical), internal functions will be available to you. Once the module is added to the package, it will be able to use its internal functions.

nikolas-burkoff commented 1 year ago

If validate_standard_inputs is useful for users developing modules that sit outside of teal.module.clinical then it could be exported - if it's meant only for teal.module.clinical developers to use then we shouldn't export it and tmc module developers can use devtools::load_all etc.

When running the example given in the validate_standard_inputs help, an error appears on the shiny app because the validate_standard_inputs object is not found:

This should be fixed.

@shajoezhu I'm going to leave this to you and let SME make any changes

shajoezhu commented 1 year ago

wiil do! Thanks @nikolas-burkoff

kaipingyang commented 1 year ago

If you run devtools::load_all() in the top directory of your repository (teal.modules.clinical), internal functions will be available to you. Once the module is added to the package, it will be able to use its internal functions. Thank you for your advice. It's very helpful.