Files
shiny/inst/examples/01_hello/server.R
2013-12-23 16:23:33 -08:00

23 lines
563 B
R

library(shiny)
# Define server logic required to generate and plot a random
# distribution
shinyServer(function(input, output) {
# Expression that generates a plot of the distribution. The
# expression is wrapped in a call to renderPlot to indicate
# that:
#
# 1) It is "reactive" and therefore should be automatically
# re-executed when inputs change
# 2) Its output type is a plot
#
output$distPlot <- renderPlot({
# generate an rnorm distribution and plot it
dist <- rnorm(input$obs)
hist(dist)
})
})