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 = "boxplot1")
)
server <- function(input, output) {
output$boxplot1 <- renderPlot ({
#Generate sample data
title <- "Sample data of population 1"
boxplot(set.seed(32), rnorm (input$num, input$mu, input$sd), main = title, col = "dark blue") })
}
shinyApp(ui=ui, server=server)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.