title: shiny: refresh plot to add new points
body: <p>I have a plot of waves where I need to identify each peak in the curve:
  <a href="https://i.stack.imgur.com/mDTJH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mDTJH.png" alt="enter image description here"></a></p>
  
  <p>I would like to do the following:</p>
  
  <p>Reactively add points to the plot where I click to mark the presence of each peak.</p>
  
  <pre><code>ui.R
  plotOutput("plot1", click = "plot_click")
  
  server.R
  output$plot1 &lt;- renderPlot({
    plot(x,y)
    points(x=input$plot_click$x,y=input$plot_click$y)
  })
  </code></pre>
  
  <p>The problem here is that although the 'plot_click' mechanism identifies the x and y position of the points- the 'points()' command only causes points to appear momentarily and then disappear.</p>
  
  <p>I also tried reactivePlot but this returned the error:</p>
  
  <pre><code>could not find function "func"
  </code></pre>