Skip to content

Instantly share code, notes, and snippets.

@EconometricsBySimulation
Forked from wch/server.r
Created June 9, 2013 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EconometricsBySimulation/5743303 to your computer and use it in GitHub Desktop.
Save EconometricsBySimulation/5743303 to your computer and use it in GitHub Desktop.
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
# Take a dependency on input$goButton
input$goButton
# Use isolate() to avoid dependency on input$obs
dist <- isolate(rnorm(input$obs))
hist(dist)
})
})
library(shinyIncubator)
shinyUI(pageWithSidebar(
headerPanel("Click the button"),
sidebarPanel(
sliderInput("obs", "Number of observations:",
min = 0, max = 1000, value = 500),
actionButton("goButton", "Go!"),
p(br(), a("View source code", href="https://gist.github.com/wch/4963887"))
),
mainPanel(
plotOutput("distPlot")
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment