title: How to make eventReactive or observeEvent for ggplot?
body: <p>I want to refresh the ggplot by click on action button. I have tried to use both: eventReactive and observeEvent and it doesn't work.</p>
  
  <pre><code>rm(server)
  rm(map3)
  
  
  ui &lt;- fluidPage(
  
    actionButton("button","button"),
    plotOutput("rys")
  )
  
  
  server &lt;- function(input, output){
  
    map3 &lt;- eventReactive(input$button,{
      ggplot(data.frame(a=runif(10)*10,b=runif(10)*10),aes(a,b))+geom_point()
    })
  
    output$rys &lt;- renderPlot({ 
      map3
      })
  }
  
  
  
  shinyApp(ui=ui, server=server)
  </code></pre>
  
  <p>Please help me I'm coding in R for 5 hours and I'm so tired and have a lot of work through this night :(</p>