'Shiny reactivity with conditional input
I am looking to make the following table reactive:
Shiny Server
output$details <- (renderTable((
if(is.null((input$Aleg1price))==FALSE) {
(data.frame(Legs = c("Leg 1:","Leg 2:"),
Position = c(input$Aleg1position,input$Aleg2position),
Strategy = c(input$Aleg1type, input$Aleg2type),
Expiration = c(input$Aleg1exp,input$Aleg2exp),
Price = c(input$Aleg1price,input$Aleg2price),
Ratio = c(input$Aleg1ratio,input$Aleg2ratio)
))
}
else{
data.frame(legs=c("Leg1","Leg2"))
}
)
))
The input input$Aleg1price comes from a conditional panel that the user will use if the condition is respected.
At the moment my issue is that when the user meets the condition that activates the conditional panel and put a value for input$Aleg1price , the table does not change accordingly (that is entering the if instead of the else)
Could you please help? Please excuse me if the question is too simple for you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
