I am trying to utilize a bit of dynamic gui activity in an application on Shiny server. My application needs a variable number of sliders created, depending on data that is input into my application. Specifically, I am trying to create sliders that set a value, one for each unique category in a input data table. I am able to successfully read my input table and create the sliders, using render UI, but I am stuck on how to best then manipulate the variable number of created input values set by the sliders - how do I go about accessing them (as a list, preferably?) Appreciate any advice or pointers. My code snippet is below.
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)
})
)
})