I would like to add a checkbox (input$autorefresh
) in my shiny application to control where my data input is auto updated (=reactive()
) at every change, or whether it is only updated when a button (=input$refresh
) is pushed. The idea is described in the following code, which I however didn't expect to work. I could use reactive()
together with a conditional isolate()
, but since I have many inputs, that is not very elegant. Any ideas?
if (input$autorefresh==TRUE){
dataInput <- reactive({
dosomething
})
} else {
dataInput <- eventReactive(input$refresh,{
dosomething
})
}