Created
January 9, 2014 17:02
-
-
Save ptoche/8337783 to your computer and use it in GitHub Desktop.
Bug Watch: sliderInput displays wrong value. Problem seems to occur for large values (k but not n). Not tested extensively. Bug reported. # ui.R
sliderInput("k", "k:", value = 1000, min = 2, max = 10000) # server.R
paste0("input$k = ",input$k) result: input$k = 1002 on start or refresh, instead of the assigned 1000.
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") | |
shinyServer( | |
function(input, output, session) { | |
output$text_n <- renderText({ | |
paste0("input$n = ",input$n) | |
}) | |
output$text_k <- renderText({ | |
paste0("input$k = ",input$k) | |
}) | |
}) |
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
# ui.R | |
library("shiny") | |
shinyUI( | |
pageWithSidebar( | |
headerPanel(h3("Debug sliderInput")) | |
, | |
sidebarPanel( | |
sliderInput("n", "n:", value = 100, min = 2, max = 1000) | |
, | |
sliderInput("k", "k:", value = 1000, min = 2, max = 10000) | |
) | |
, | |
mainPanel( | |
textOutput("text_n") | |
, textOutput("text_k") | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue reported here:
rstudio/shiny#365