I am trying to rebase something if the rebase button is clicked (input$rebase). If it is not clicked, then I want the code to continue with value_new just being value. But if it is clicked, then i want to use the output from rebasesomething ie, i want value_new to be value * 0.5.
How can i do this? I tried the ifexists to see if that function has an output or not (ie if the button has been clicked and some output generated), but that doesn't seem to work. Any other ideas on how this could be done?
Sorry to not give a working example, but the code is huge, just hoping someone can guide me in the right direction.
reactive({
value <- input$value
value_new<-value
ifexists(rebasesomething()){value_new<-value*rebasesomething()}
#do a whole bunch of other things with value_new
})
rebasesomething <- eventReactive(input$rebase,{
temp<-0.5
temp
})
ifexists
come from? – MrFlick