Skip to content

Instantly share code, notes, and snippets.

@RanaivosonHerimanitra
Created April 17, 2014 09:25
Show Gist options
  • Save RanaivosonHerimanitra/10968134 to your computer and use it in GitHub Desktop.
Save RanaivosonHerimanitra/10968134 to your computer and use it in GitHub Desktop.
library(shiny)
# Define server logic for random distribution application
shinyServer(function(input, output,session) {
data <- reactive({
dist <- switch(input$dist,
norm = rnorm,
unif = runif,
lnorm = rlnorm,
exp = rexp,
rnorm)
dist(input$n)
})
# Generate a summary of the data
output$summary <- renderPrint({
summary(data())
})
# Generate an HTML table view of the data
output$idmytable <- renderTable({
data.frame(x=data())
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment