CTU-Bern / presize

Precision Based Sample Size Calculation
https://ctu-bern.github.io/presize/
GNU General Public License v3.0
15 stars 13 forks source link

Reporting error: sensitivity and specificity in shiny app #72

Closed TomKellyGenetics closed 3 years ago

TomKellyGenetics commented 3 years ago

Describe the bug Shiny app () returns error as shown:

ntot' required when 'prev' is specified

To Reproduce See screenshots. Hosted locally with:

launch_presize_app()

Development version installed with remotes::install_github("aghaynes/presize"). Commit: https://github.com/aghaynes/presize/commit/a917c32fc886dfd2f8eee9f7c6743f2803134cf8

Expected behavior Prevalence input is required by ShinyApp. It is possible to use a button to disable it. Slider could be removed from UI with conditional input.

Estimating sample size from conf.width without specifying n is not currently supported in Shiny App. Cannot specify ntot from Shiny App.

Screenshots

Screen Shot 2021-04-07 at 15 05 15 Screen Shot 2021-04-07 at 15 05 30

Desktop (please complete the following information):

R version 4.0.3 (2020-10-10)
 os       macOS Catalina 10.15.7      
 system   x86_64, darwin17.0          
   presize        * 0.2.2      2021-04-07 [1] Github (aghaynes/presize@a917c32)
TomKellyGenetics commented 3 years ago

As a note on the Shiny App. The locale issue discussed in #61 seems to be resolved now. The Shiny App launches in various locale settings and I cannot reproduce the error (possibly caused by dependencies).

> Sys.setenv(LANG = "fr")
> 2 = x
Error in 2 = x : membre gauche de l'assignation (do_set) incorrect

> presize::launch_presize_app()

Listening on http://127.0.0.1:6747

> Sys.setenv(LANG = "ja")
> 2  + x
 エラー:  オブジェクト 'x' がありません 

> presize::launch_presize_app()

Listening on http://127.0.0.1:6747

> Sys.setenv(LANG = "")
> presize::launch_presize_app()

Listening on http://127.0.0.1:6747

> Sys.setenv(LANG = "en")
> 2 + x
Error: object 'x' not found

> presize::launch_presize_app()

Listening on http://127.0.0.1:6747

> Sys.setenv(LANG = "UTF8")
> 2+ x
Error: object 'x' not found
> presize::launch_presize_app()

Listening on http://127.0.0.1:6747
aghaynes commented 3 years ago

thanks for reporting this @TomKellyGenetics, I'll make the fix... should be easy enough i think...

TomKellyGenetics commented 3 years ago

I've tested installing from GItHub and verified that the Shiny App now works as expected. 👍