Created
May 27, 2014 20:42
-
-
Save HermanSontrop/598b3c81fb6c118759ed to your computer and use it in GitHub Desktop.
simple slider update demo
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(datasets) | |
shinyServer(function(input, output) { | |
output$mSlider <- renderUI({ | |
input$updateSlider | |
Range <- sample(1:100)[1:2] | |
Lambda <- runif(1) | |
Value <- Lambda*Range[1] + (1-Lambda)*(Range[2]) | |
sliderInput("mInput",label = "slider input",min = min(Range), max = max(Range), value =Value ) | |
}) | |
}) | |
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(shiny) | |
shinyUI(fluidPage( | |
fluidRow( | |
br(), | |
h1("update slider example") | |
), | |
fluidRow( | |
column(2, | |
uiOutput("mSlider"), | |
actionButton(inputId = "updateSlider", "update slider") | |
) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment