Say I do an observeEvent like this where I generate random numbers, and then another to export those numbers to a csv:
observeEvent(input$generateButton, {
u = runif(input$nNumericInput)
})
observeEvent(input$exportButton, {
write.csv(data.frame(u),"randomNumbers.csv", row.names = FALSE)
})
That's basically what I'm trying to do but I'm generating the numbers in a more complex way that I don't want to repeat for each button because of efficieny.