Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Confusing parameters and hidden processing in tm_g_spiderplot #269

Open
3 tasks done
lcd2yyz opened this issue Jun 7, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working core

Comments

@lcd2yyz
Copy link

lcd2yyz commented Jun 7, 2024

What happened?

Several parameters in tm_g_spiderplot function is not working as expected.

  1. Referring to the web manual https://insightsengineering.github.io/teal.osprey/main/reference/tm_g_spiderplot.html and example code, NULL is supposed to be the default value for parameters vref_line and href_line. However, if modifying the example code to vref_line = NULL or href_line = NULL will get the following error
Error in tm_g_spiderplot(label = "Spider plot", dataname = "ADTR", paramcd = choices_selected(choices = "SLDINV",  : 
  Assertion on 'vref_line' failed: Must be of type 'string', not 'NULL'.
  1. Parameter anno_txt_var needs logical value for the function to work. This is not consistent with the parameter name and different from other parameters like x_var or marker_var. It make more sense to allow user to specify the variable to be used as the annotation text.

  2. In relation to 2, function is hardcoded to use USUBJID as the label (if parameter anno_txt_var = TRUE). However, there is an additional data processing step here that string split the value by dash symbol as delimiter. This processing is also hard-coded and cannot be turned off.

In situations where the input dataset has values USUBJID = c('site1-0001', 'site1-0002', 'site2-0001'), both the first and last subjects will be shown as the same subject with ID 0001, which is incorrect.

sessionInfo()

R version 4.3.3 (2024-02-29)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Toronto
tzcode source: internal

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

other attached packages:
 [1] sparkline_2.0               teal.osprey_0.1.16.9019     osprey_0.1.16               dplyr_1.1.4                
 [5] teal.modules.clinical_0.9.1 tern_0.9.4                  rtables_0.6.7               magrittr_2.0.3             
 [9] formatters_0.5.6            teal.modules.general_0.3.0  teal.transform_0.5.0        teal_0.15.2                
[13] teal.slice_0.5.1            teal.data_0.6.0             teal.code_0.5.0             shiny_1.8.1.1              
[17] ggmosaic_0.3.3              ggplot2_3.5.1              

loaded via a namespace (and not attached):
 [1] tidyselect_1.2.1      viridisLite_0.4.2     farver_2.1.2          fastmap_1.2.0         lazyeval_0.2.2       
 [6] promises_1.3.0        shinyjs_2.1.0         labelled_2.13.0       digest_0.6.35         estimability_1.5.1   
[11] mime_0.12             tern.gee_0.1.3        lifecycle_1.0.4       survival_3.5-8        compiler_4.3.3       
[16] rlang_1.1.3           sass_0.4.9            tools_4.3.3           yaml_2.3.8            utf8_1.2.4           
[21] data.table_1.15.4     knitr_1.47            labeling_0.4.3        htmlwidgets_1.6.4     withr_3.0.0          
[26] purrr_1.0.2           shinyWidgets_0.8.6    geepack_1.3.10        grid_4.3.3            fansi_1.0.6          
[31] teal.logger_0.2.0     xtable_1.8-4          colorspace_2.1-0      emmeans_1.10.2        scales_1.3.0         
[36] MASS_7.3-60.0.1       cli_3.6.2             mvtnorm_1.2-5         rmarkdown_2.27        generics_0.1.3       
[41] rstudioapi_0.16.0     httr_1.4.7            cachem_1.1.0          splines_4.3.3         vctrs_0.6.5          
[46] Matrix_1.6-5          jsonlite_1.8.8        hms_1.1.3             ggrepel_0.9.5         teal.widgets_0.4.2   
[51] plotly_4.10.4         fontawesome_0.5.2     tidyr_1.3.1           jquerylib_0.1.4       glue_1.7.0           
[56] gtable_0.3.5          later_1.3.2           shinycssloaders_1.0.0 munsell_0.5.1         tibble_3.2.1         
[61] logger_0.3.0          pillar_1.9.0          htmltools_0.5.8.1     R6_2.5.1              Rdpack_2.6           
[66] evaluate_0.23         lattice_0.22-5        haven_2.5.4           rbibutils_2.2.16      backports_1.5.0      
[71] memoise_2.0.1         broom_1.0.6           renv_1.0.7            teal.reporter_0.3.1   httpuv_1.6.15        
[76] bslib_0.7.0           Rcpp_1.0.12           shinyvalidate_0.1.3   nlme_3.1-164          checkmate_2.3.1      
[81] xfun_0.44             forcats_1.0.0         pkgconfig_2.0.3

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@lcd2yyz lcd2yyz added the bug Something isn't working label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

2 participants