Skip to content

Instantly share code, notes, and snippets.

@ptoche
Created January 9, 2014 17:02
Show Gist options
  • Save ptoche/8337783 to your computer and use it in GitHub Desktop.
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.
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)
})
})
# 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")
)
)
)
@ptoche
Copy link
Author

ptoche commented Jan 15, 2014

Issue reported here:

rstudio/shiny#365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment