Last active
January 3, 2016 20:02
-
-
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
This file contains hidden or 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
function(input,output) { | |
output$sliderout <- renderText({ | |
if (exists_as_numeric(input$numinput)) { | |
isolate(input$sliderinput) | |
} | |
}) | |
output$numout <- renderText({ | |
input$numinput | |
}) | |
} |
This file contains hidden or 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) | |
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