Quantcast
Viewing all articles
Browse latest Browse all 3

R Shiny: eventReactive with two controls

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

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>