title: Downloadhander (save plot) for basic plot in shiny
body: <p>How to save plot using download button in shiny?<br>
  I know how to do it for ggplot, but I can't find how to do it for basic <code>plot()</code>.  </p>
  
  <p>Example:</p>
  
  <pre><code>library(shiny)
  library(ggplot2)
  
  
  # ui
  ui &lt;- fluidPage(
    downloadButton("save", "save")
  )
  
  
  # server
  server &lt;- function(input, output){
  
    p &lt;- reactive({ggplot(iris, aes(Sepal.Length, Sepal.Width)) + geom_point()})
    p2 &lt;- reactive({dotchart(iris$Sepal.Length, iris$Species, iris$Species)})
  
    output$save &lt;- downloadHandler(
      file = "save.png" , # variable with filename
      content = function(file) {
        ggsave(p(), filename = file)
      })
  }
  
  
  # run
  shinyApp(ui, server)
  </code></pre>
  
  <p>above there is implemented saving the plot <code>p</code>. Now how to implement saving the plot <code>p2</code> ?</p>