Skip to content

Instantly share code, notes, and snippets.

@homerhanumat
Last active January 3, 2016 20:02
Show Gist options
  • Save homerhanumat/02fcf273180e29c57659 to your computer and use it in GitHub Desktop.
Save homerhanumat/02fcf273180e29c57659 to your computer and use it in GitHub Desktop.
Shiny app illustrating a slider that appears to wait for the user to enter a number in a numericInput field
function(input,output) {
output$sliderout <- renderText({
if (exists_as_numeric(input$numinput)) {
isolate(input$sliderinput)
}
})
output$numout <- renderText({
input$numinput
})
}
library(shiny)
basicPage(
title = "Slider 'Waits' for Numerical Input",
sliderInput(inputId = "sliderinput", label = "Slider",
min = 0, max = 100, step = 1, value = 0),
verbatimTextOutput("sliderout"),
numericInput(inputId = "numinput", label = "Enter a Number", value = NULL),
verbatimTextOutput("numout")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment