Quantcast
Channel: R Shiny: eventReactive with two controls - Stack Overflow
Viewing all articles
Browse latest Browse all 3

R Shiny: eventReactive with two controls

$
0
0

I have the following R Shiny code:

  economics_points <- eventReactive(input$sigmaThresholdSlider, {    print("input$sigmaThresholdSlider fired.")    get_points(input$daterange, 1, input$sigmaThresholdSlider)  }, ignoreNULL = FALSE)  economics_points <- eventReactive(input$daterange, {    print("input$daterange fired.")    get_points(input$daterange, 1, input$sigmaThresholdSlider)  }, ignoreNULL = FALSE)

The problem is that economics_points is only updated when the daterange control is changed, not when the sigmaThresholdSlider control is changed. If I reverse the order of the two statements, economics_points is only updated when sigmaThresholdSlider is moved. In other words, the second statement overrides the first.

How do I change this code so that it runs when either control is adjusted?

The documentation says that the eventExpr argument of eventReactive can be "even a complex expression inside curly braces", but no helpful examples are given.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images