diff --git a/shiny/distProb/server.R b/shiny/distProb/server.R index 5e7dfbba0b1614c8a42bd40134b4985b07032a84..b85889ecbd629d9b6ab83da792f9a73eaef415e8 100644 --- a/shiny/distProb/server.R +++ b/shiny/distProb/server.R @@ -277,4 +277,42 @@ shinyServer( ) ## switch() }) ## renderUI + + ## Opções para média amostral + output$OptsMedia <- renderUI({ + if (input$tab == "Distribuição") { + return(NULL) + } else { + wellPanel( + numericInput( + inputId="n", + label="Tamanho da amostra:", + min = 2, max = 1000, value=10), + HTML("<label>Tipo de gráfico: </label>"), + tabsetPanel( + id = "graf", + type = "pills", + tabPanel("Density"), + tabPanel("ECDF"), + tabPanel("Q-QNorm") + ), + helpText("Baseados em 500 amostras") + ) + } + }) + + ## Gráficos para a distribuição média amostral + output$grafsMedia <- renderUI({ + if (is.null(input$graf)) { + return(NULL) + } else { + switch( + input$graf, + "Density" = plotOutput("density"), + "ECDF" = plotOutput("ecdf"), + "Q-QNorm" = plotOutput("qqnorm") + ) + } + }) + }) ## shinyServer() diff --git a/shiny/distProb/ui.R b/shiny/distProb/ui.R index c20a026691ecdde8ba38df442bcf3554da862544..da960cd29405b64c1def9bb10dd212978d641cc5 100644 --- a/shiny/distProb/ui.R +++ b/shiny/distProb/ui.R @@ -13,19 +13,22 @@ shinyUI( titlePanel("Distribuições de probabilidade"), sidebarPanel( - numericInput(inputId="n", - label="Tamanho da amostra:", - value=10), selectInput(inputId="dist", label="Distribuição", choices=choi), - uiOutput("ui") + uiOutput("ui"), + + uiOutput("OptsMedia") ), mainPanel( - plotOutput("plot"), - plotOutput("density"), - plotOutput("ecdf"), - plotOutput("qqnorm") + tabsetPanel( + id = "tab", + tabPanel("Distribuição", + plotOutput("plot")), + tabPanel("Distribuição Amostral da Média", + uiOutput("grafsMedia") + ) + ) ) ) ) \ No newline at end of file