R/shiny_y.R

Defines functions server

library(shiny)

ui <- fluidPage(

  #App title
  titlePanel("Descriptive and Inferential Statistics"),

  #Slidebar for input
  sliderInput( inputId = "num", label = "Choose the sample size:",
               value = 25, min = 0, max = 100),
  sliderInput( inputId = "mu", label = "Choose the sample mean:",
               value = 5, min = 0, max = 10),
  sliderInput( inputId = "sd", label = "Choose the sample standard deviation:",
               value = 5, min = 0, max = 20),
  checkboxInput(inputId = "pairing", label = "Is the data paired?",
                value = FALSE),

  plotOutput(outputId = "boxplot2")
)

server <- function(input, output) {

  output$boxplot2 <- renderPlot ({
    #Generate sample data

    title <- "Sample data of population 2"
    boxplot(set.seed(32), rnorm (input$num, input$mu, input$sd), main = title, col = "dark red") })


}

shinyApp(ui=ui, server=server)
ElahehJafarigol/R.Package.Stat documentation built on April 29, 2020, 12:25 a.m.