From 41e1ea1ad84ba051af202539d174d962d249986f Mon Sep 17 00:00:00 2001 From: Fred Jaya <36436914+fredjaya@users.noreply.github.com> Date: Mon, 27 May 2024 14:12:27 +1000 Subject: [PATCH] MAINT: rename cluster/hierarchical UI. #31 Also clean comments and fct prep for power calcs. --- dev/test.Rmd | 12 ++++++++++++ server.R | 2 +- ui.R | 14 +++++++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/dev/test.Rmd b/dev/test.Rmd index e179423..f552939 100644 --- a/dev/test.Rmd +++ b/dev/test.Rmd @@ -299,6 +299,18 @@ is_integer_col(simple, "NumInPool") is.numeric(simple[["NumInPool"]]) ``` +### Power calculations + +4 functions: +- `power_pool()` +- `sample_size_pool()` +- `power_pool_random()` +- `sample_size_pool_random()` + +```{r} +PoolPoweR::power_pool +``` + diff --git a/server.R b/server.R index b6e6e7d..d6c1a0b 100644 --- a/server.R +++ b/server.R @@ -126,7 +126,7 @@ server <- function(input, output, session) { req(stratify_valid()) tagList( tags$hr(style = "border-top: 1px solid #CCC;"), - checkboxInputTT("optsHierarchy", "Adjust for hierarchical sampling?", + checkboxInputTT("optsHierarchy", "Cluster/hierarchical sampling?", tooltip = "Apply a hierarchical model to minimise overestimating confidence/credible intervals", value = FALSE ) ) diff --git a/ui.R b/ui.R index a15cefa..97897af 100644 --- a/ui.R +++ b/ui.R @@ -4,6 +4,7 @@ ui <- fluidPage( ## Main navbar and pages navbarPage(paste0("PoolTools v", appVersion), id = "main_nav", + ## Home ---- tabPanel( "Home", fluidRow( @@ -27,10 +28,12 @@ ui <- fluidPage( ) ) ), + ## About ---- tabPanel( "About", includeMarkdown("inst/app/www/about.md") ), + ## Analyse ---- tabPanel( "Analyse", h2("Analyse pooled data"), @@ -75,6 +78,7 @@ ui <- fluidPage( ) ) ), + ## Design ---- tabPanel( "Design", h2("Design a pooled survey"), @@ -83,7 +87,7 @@ ui <- fluidPage( sidebarPanel( style = "max-height: 75vh; overflow-y: auto;", - # Survey options ------------------------------------ + ### Survey options ---- selectInputTT( "optsMode", "Analysis mode", @@ -109,12 +113,12 @@ ui <- fluidPage( ), checkboxInputTT( "optsClustered", - "Clustered design?", + "Cluster/hierarchical sampling?", tooltip = "tooltip", value = TRUE ), - # Main settings ------------------------------------- + ### Main settings ---- # UI are conditional based on survey options uiOutput("uiRandPrev"), uiOutput("uiCost"), @@ -122,7 +126,7 @@ ui <- fluidPage( uiOutput("uiDesignAdv"), textOutput("uiValidOther"), uiOutput("btnDesign") - ), # End of sidebarPanel ------------------------------ + ), ### End of sidebarPanel ---- mainPanel( tabsetPanel( @@ -138,7 +142,7 @@ ui <- fluidPage( ) ) ) - ) # End of sidebarLayout ------------------------------- + ) ### End of sidebarLayout ---- ) ) )