Adding multiple conditions to a conditionalPanel in Shiny

I was wondering if it is possible to add more than one condition to a conditionalPanel brilliant. This is an example:

  conditionalPanel(condition = "input.SELECT == 1", #Slider sliderInput("D_FLAG", "Parameter X:", min = 0.001, max = 3, value = 1.38, step = 0.1)) 

I want to add another condition (except input.SELECT==1 ). I tried this, but it did not work.

 conditionalPanel(condition = c("input.SELECT == 1","input.FED==2"), #Slider sliderInput("D_FLAG", "Parameter X:", min = 0.001, max = 3, value = 1.38, step = 0.1)) 

but it didn’t work. I would appreciate if someone could correctly enter some input to include several conditions in the conditionalPanel above.

+5
source share
1 answer

You can have it as hard as you want, as long as it evaluates to TRUE or FALSE at the end. You probably want to combine two conditions: either with AND && , or OR || like this (for OR):

 "input.SELECT == 1 || input.FED == 2" 
+15
source

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


All Articles