title: Shiny - Editing rhandsontable tables with multiple input and output elements
body: <p>I've been working with this post as a starting point.
  <a href="https://stackoverflow.com/questions/33722757/update-handsontable-by-editing-table-and-or-eventreactive#33739317">Update handsontable by editing table and/or eventReactive</a></p>
  
  <p>Very helpful, but I'm trying to extend it to specify the number of values in the table, then update a plot based on the table values after editing.</p>
  
  <p>Here's what I have so far.</p>
  
  <pre><code>library(shiny)
  library(rhandsontable)
  library(colorSpec)
  
  ui &lt;- fluidPage(
    numericInput("x", "number of values", 2),
    rHandsontableOutput('table'),
    textOutput('result'),
    plotOutput('plot'),
    actionButton("recalc", "generate new random vals and calculate")
  )
  
  
  server &lt;- function(input,output,session)({
    values &lt;- reactiveValues(data=as.data.frame(runif(input$x)))
  
    observe({
      input$recalc
      values$data &lt;- as.data.frame(runif(input$x))
    })
  
    observe({
      if(!is.null(input$table))
        values$data &lt;- hot_to_r(input$table)
    })
  
  
    output$table &lt;- renderRHandsontable({
      rhandsontable(values$data)
    })
  
  
    output$result &lt;- renderText({
      sum(values$data)
    })
  
    output$plot &lt;- reactivePlot({
      barplot(values$data)
    })
  
  })
  
  shinyApp(ui = ui, server = server)
  </code></pre>
  
  <p>I get an error on the <code>reactiveValues</code> line because I'm trying to use <code>input$x</code>.  The previous post had a hard coded value of 2.  </p>