Access to inputs created in renderUI in Shiny

I am trying to use some dynamic gui activity in an application on a Shiny server. My application requires a variable number of created sliders, depending on the data that is entered into my application. In particular, I am trying to create sliders that set a value, one for each unique category in the input data table. I can successfully read the input table and create sliders using the visualization interface, but I got stuck on how best to manipulate the variable number of generated input values ​​given by the sliders - how can I access them (as a list, preferably?) Appreciate any advice or pointers. The following is a snippet of code.

output$sliders <- renderUI({

# if we don't need the sliders, return
if (input$unequalpts == "no")
  return(NULL)
# go to panel where sliders are to appear
updateTabsetPanel(session, "inTabSet", selected = "Unequal")
# get the number of unique entries the field f interest to create sliders for
theDATA <- myData()
theFields <- unique(as.character(theDATA$shnystr))

return  (
    lapply(1:numstrata, function(i) {
      sliderInput(inputId = paste0("strata", i), label = paste("strata ", theFields[i]),
                min = 0, max = 100, value = c(0, 100), step = 1)
  })
  ) 
})
+4
1

input$foo foo. input[['foo']], id input :

lapply(1:numstrata, function(i) {
  input[[paste0("strata", i)]]
})
+2

Source: https://habr.com/ru/post/1540915/


All Articles