-
-
Save EconometricsBySimulation/5743303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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