In my shiny app I have a selectInput with multiple=True. This allows to select several variables from a list. I would like to add conditionalPanel for every variables of the list which will be display only when the variable is selected.
Exemple :
shinyUI(fluidPage(
sidebarPanel(
selectInput("variables", "Choose variables" , choices = c("VAR1", "VAR2", "VAR3", "VAR4"), multiple=TRUE),
conditionalPanel(
condition = " input.variables == 'VAR1' ",
selectInput("VAR1", "values", c("A", "B", "C"))
)
),
mainPanel(
)
)
The problem is since I choose several variables my condition input$variables == 'VAR1' is false because input.variables contains several values. What condition would work here ? In R the condition would be : "VAR1" %in% input.variables
Thank you