title: edit a reactive database
body: <p>Trying to edit a reactive database so that updates to the database are reflected in the output.
  Have tried numerous variants, but none are working, general idea is shown - where I would like to have the figure update with changes to the database.</p>
  <pre><code>library(tidyverse)
  library(shiny)
  library(DT)
  
  # Define UI for application that draws a histogram
  ui &lt;- fluidPage(
  
      sidebarLayout(
          sidebarPanel(
              sliderInput(&quot;ages&quot;, &quot;Max age:&quot;, 10, 100, 15),
              sliderInput(&quot;nsamp&quot;,
                          &quot;Sample size:&quot;,
                          min = 10,
                          max = 1000,
                          value = 100)),
          
          mainPanel(dt_output('Sample sizes and weighting', 'x1'),
                    plotOutput(&quot;fig&quot;))
      )
  )
  
  server &lt;- function(input, output) {
     
      x = reactive({
          df = data.frame(age = 1:input$ages,
                          samples = input$nsamp,
                          weighting = 1)
      })
  
      output$x1 = renderDT(x(), 
                           selection = 'none', 
                           editable = TRUE,
                           server = TRUE,
                           rownames = FALSE)
  
      output$fig =  renderPlot({
          ggplot(x(), aes(age, samples)) +
            geom_line() +
            geom_point()
      })
      
  }
  
  shinyApp(ui = ui, server = server)
  </code></pre>