Redraw shiny plot after updating data frame?
<p>I have built a Shiny app with a database backend - </p>

<p>Im trying to reload the dataframe <code>current_data_frame</code> and redraw the plot using it when <code>input$draw_plot</code> (action button) is pressed.</p>

<p>I am having trouble re-drawing the plot after recalling the data frame?</p>

<p>Any ideas what I am missing?? </p>

<p>snippet from server.R   </p>

<pre><code>  current_data_frame = data.frame(matrix(ncol = 4, nrow = 0))
  names( current_data_frame ) &lt;- c("sample_id", "call", "intensity_A" , "intensity_B")


  # OBSERVE BUTTON PRESS &amp; UPDATE DATA FRAME
  observeEvent( input$draw_plot, {
                current_data_frame &lt;- get_data_frame( input$probeset_id , input$study_id , input$batch_id)

                }) 

  vals &lt;- reactiveValues(
                        keeprows = rep(TRUE, nrow( current_data_frame ))
                        )

  output$call_plot &lt;- renderPlot({
                        # Lists for holding unactive_points                      
                        keep    &lt;- current_data_frame[ vals$keeprows, , drop = FALSE]
                        exclude &lt;- current_data_frame[ !vals$keeprows, , drop = FALSE]
                        # Le plot 
                        ggplot(keep, aes( intensity_A , intensity_B)) +
                          geom_point(aes(colour = factor(call), shape = factor(call)) )  #+ 
                          #geom_point(data = exclude, shape = 21 , fill = NA, colour = "black", alpha = 0.25)

                        })

                        # Toggle click points 
                        observeEvent( input$call_plot_click, {
                          res &lt;- nearPoints(current_data_frame, input$call_plot_click, allRows = TRUE)

                        vals$keeprows &lt;- xor(vals$keeprows, res$selected_)
                        })

                        # Toggle points that are brushed when clicked 

                        observeEvent(input$exclude_toggle, {
                          res &lt;- brushedPoints(current_data_frame, input$call_plot_brush, allRows = TRUE)

                          vals$keeprows &lt;- xor(vals$keeprows, res$selected_)
                        })

                        # Reset all points 

                        observeEvent( input$exclude_reset, {
                          vals$keeprows &lt;- rep( TRUE, nrow(current_data_frame))
                        })

})  
</code></pre>