Q: R shiny Multiple slider inputs based on checkbox inputs I have used the below code to create checkbox from my data.I would like to create slider input for each checkbox I select from the list.For example if the checkbox has 4 variables like "sky","earth","water","fire" and if I select sky, it should dynamically open a slider input for sky and if I select water it should open up one more slider input for water. I tried conditionalPanel,but I have more than 50 variables in my checkbox,so i cannot write condition for all the 50 variables. Is there any generalized method available in shiny?
server
output$choosedigital=renderUI({

if(is.null(bk$variables))
   return()

checkboxGroupInput("choosemedia", "Choose digital", 
                    choices  = bk$variables,
                    selected = bk$variables)
})


  output$test <- renderUI({
  LL <- list(rep(0,length(input$choosedigital)))     
  for(i in 0:(length(input$choosedigital))) {
   LL[i] <- list(sliderInput(inputId = paste(input$choosedigital,i)
                             , label = paste(input$choosedigital,i), 
  min=0,max=25,value = 5))
  }       
  return(LL)                      
  })


A: You want to put your sliderInputs inside a conditionalPanel in the UI and set the condition so that when the relevant checkbox is clicked the the condition equates to TRUE.
e.g.
library(shiny)
myData = c("One", "Two", "Three")

ui <- fluidPage(

  checkboxGroupInput("choosemedia", "Choose digital", 
                     choices  = myData,
                     selected = myData),
  textOutput("myText"),
  conditionalPanel(condition = "input.choosemedia.includes('One')", 
                   sliderInput("sliderOne", "Choose your value", min=0, max=100, value=50)
  ),
  conditionalPanel(condition = "input.choosemedia.includes('Two')",
                   sliderInput("sliderTwo", "Choose your other value", 

min=0, max=50, value=25))
    )

# Define server logic 
server <- function(input, output) {
  output$myText <- renderText({input$choosemedia})

}
# Run the application 
shinyApp(ui = ui, server = server)

If long as you know what the content of bk$variables is you can hardcode them, otherwise you'll have to generate these on the fly.
Hope this is enough info to get you going.
