Skip to content

Instantly share code, notes, and snippets.

@HermanSontrop
Created May 27, 2014 20:42
Show Gist options
  • Save HermanSontrop/598b3c81fb6c118759ed to your computer and use it in GitHub Desktop.
Save HermanSontrop/598b3c81fb6c118759ed to your computer and use it in GitHub Desktop.
simple slider update demo
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 )
})
})
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