1

Could you please help with an example how I could trigger an eventReactive expression to kick in by an "actionbutton" OR by picking another item (than default) from selectInput such as:

DAT<-eventReactive(input$action_button | input$sel_input_menu,{

rest of the code comes here that gets executed whenever I either hit the "actionbutton" or change the state of the selectInput...

})
Tamas
  • 109
  • 8
  • When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jun 13 '18 at 16:48
  • The code should work, however your `eventReactive` which is `DAT()` has to be bound to something further down the line or it will not trigger – Pork Chop Jun 13 '18 at 16:55

1 Answers1

3

You need to wrap your two inputs in c() and pass them as an expression to the first argument in eventReactive(), like such:

DAT<-eventReactive({ c(input$action_button,input$sel_input_menu) },{
        # do some stuff
    })
Jeremy Bowyer
  • 142
  • 2
  • 5