Closed kaipingyang closed 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?
This case is not reproducible on my machine,
validate_standard_inputs
is still a valid function inteal.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
@kaipingyang could you start with a new session and load teal.modules.clinical
and test again please?
@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 byrenv
in R project . At present, all questions about validate_standard_inputs areError: object 'validate_standard_inputs' not found
1.linux system install development version of teal: The result is as above
> 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
@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:
Please check the document at https://github.com/insightsengineering/teal.modules.clinical/blob/main/NAMESPACE
@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.
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 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 usevalidate_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 usevalidate_standard_inputs
for validation, I have to comment out the code forvalidate_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 usevalidate_standard_inputs
if possible.
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.
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
wiil do! Thanks @nikolas-burkoff
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.
What happened?
Error: object 'validate_standard_inputs' not found
Most modules use
validate_standard_inputs
to check variables,such asIn teal.modules.clinical version 0.8.14.9021 we can query the
help(validate_standard_inputs)
for the validate_standard_inputs function, butThe validate_standard_inputs object is not found when we enter
validate_standard_inputs
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:
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")
}) } if (interactive()) { shinyApp(ui, server) }
Relevant log output
Code of Conduct
Contribution Guidelines
Security Policy