title: In R shiny, how can I use data that I generated in an observeEvent (button click) outside of that observeEvent?
body: <p>Say I do an observeEvent like this where I generate random numbers, and then another to export those numbers to a csv:</p>
  
  <pre><code>  observeEvent(input$generateButton, {
      u = runif(input$nNumericInput)
    })
    observeEvent(input$exportButton, {
      write.csv(data.frame(u),"randomNumbers.csv", row.names = FALSE)
    })
  </code></pre>
  
  <p>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.</p>