I'm able to create multiple sliders and selections dynamically (data driven) in Shiny UI but don't know how to retrieve resulting user selected values. My objective is to use the selected values in other functions.
Does someone know the syntax to retrieve these values? Here's an example for the sliders:
library(shiny)
ui <- fluidPage(
uiOutput("sliders"),
tableOutput("values")
)
server <- function(input, output) {
output$sliders <- renderUI({
c <- c("A", "B", "C")
min <- c(10,100,1000)
max <- c(50,500,5000)
sliders <- lapply(1:length(c), function(i) {
inputName <- c[i]
min <- min[i]
max <- max[i]
sliderInput(inputName, inputName, min=min, max=max, value=0)
})
do.call(tagList, sliders)
})
# don't know how to retrieve slider values??
output$values <- renderTable({
d <- data.frame(input$inputName)
})
}
shinyApp(ui = ui, server = server)