title: R Shiny app seems to hang when generating data
body: <p>Colleagues,</p>
  <p>I'm creating a Shiny app that can generate a data set with user-defined properties. The intended data-generation function can take some time, so I've substituted a very simple one.</p>
  <p>My problem is that the app seems to just hang, or nothing happens at all, when I hit the GO button.</p>
  <p><strong>DEBUG</strong> in <em>Rstudio</em> shows nothing, and <strong>reactlog</strong> also gives no information.
  Similar questions on this stack<strong>overflow</strong> forum are more than 8 years old, and suggestions don't seem to work either.</p>
  <p>I'm sure the solution is head-slapping simple but, right now, I'm lost.</p>
  <p>Any suggestions from those more knowledgeable than this <em>Shiny</em> newbie?</p>
  <pre><code>## generate data set with user-defined parameters
  
  ## load libraries
  library(shiny)
  library(ggplot2)
  library(DT)
  
  ##
  
  options(shiny.reactlog = TRUE)
  
  # Define UI
  ui &lt;- fluidPage(
  
    # Application title
    titlePanel(&quot;Synthesise data&quot;),
  
    # Sidebar
    sidebarLayout(
      sidebarPanel(
  
        ## Sample size
        numericInput(&quot;sample_n&quot;, &quot;Sample size&quot;, 30,
          min = 10, max = 300, step = 1
        ),
        h4(&quot;Desired scale moments&quot;),
        numericInput(&quot;target_mean&quot;, &quot;Target mean&quot;, 4),
        numericInput(&quot;target_sd&quot;, &quot;Target st dev&quot;, 1),
        hr(style = &quot;border-top: 1px solid #000000;&quot;),
        actionButton(&quot;goButton&quot;, &quot;Go!&quot;),
        actionButton(&quot;goChart&quot;, &quot;show chart&quot;),
      ),
      mainPanel(
        h4(&quot;generated data&quot;),
        # table of generated data
        DT::dataTableOutput(&quot;mytable&quot;),
        # Show a plot of the generated distribution
        plotOutput(&quot;resultPlot&quot;)
      )
    )
  )
  
  # Define server logic
  server &lt;- function(input, output) {
    mytable &lt;- reactive(input$goButton, {
      ## substituting data-gen function that can take some time
      mydata &lt;- rnorm(sample_n, target_mean, target_sd) |&gt;
        data.frame()
      colnames(mydata) &lt;- &quot;scale&quot;
  
      # saveRDS(mydata, file = &quot;generatedData.RDS&quot;)
  
      output$mytable &lt;- DT::renderDataTable(DT::datatable({
        mydata
      }))
    })
  
    myplot &lt;- eventReactive(input$goChart, {
      output$resultPlot &lt;- renderPlot({
        ggplot(mydata, aes(x = scale)) +
          geom_density()
      })
    })
  }
  # Run the application
  shinyApp(ui = ui, server = server)
  
  </code></pre>