title: Using a download handler to save ggplot images in shiny
body: <p>I am developing an application in shiny.In shiny, I am rendering a simple plot using the action button. I have included a download button to download the the plot that is now in UI. from my  code(plot3)</p>
  
  <p>I tried the below code, to save the image, but I am getting an error </p>
  
  <blockquote>
    <p>plotInput not found.</p>
  </blockquote>
  
  <p>Could any one suggest where i am going wrong.</p>
  
  <p>Below is my code for reference.
  UI:</p>
  
  <pre><code>ui &lt;- tabItem(tabName = "models2",
          fluidPage(
            fluidRow(
              infoBoxOutput("overview")
            ),
            fluidRow(
              actionButton("result1","Generate Result"),
              downloadButton('downloadPlot','Download Plot'),
              plotOutput("plot3")
            )
          ))
  </code></pre>
  
  <p>SERVER</p>
  
  <pre><code>server &lt;- function(input,output,session{
   output$overview &lt;- renderValueBox({
        valueBox(
          paste("91"),"Overview",icon=icon("hourglass"),
          color="green"
        )
      })
    observeEvent(input$result1,{
    output$plot3  &lt;- renderPlot({
      ggplot(data=timedata, aes(x=dat1, y=yes, group=3))+ 
        geom_point(shape=1)+
        coord_cartesian(xlim=c(dat1_xlowlim,dat1_xhighlim))+
        labs(title="Probability",x="Date",y="True probability")  
    })
    })
    output$downloadPlot &lt;- downloadHandler(
      filename = function(){paste(input$plot3,'.png',sep='')},
      content = function(plot3){
        ggsave(plot3,plotInput())
  
      }
    )
  })
  </code></pre>
  
  <p>Also, to note my shiny and R studio are in R environment.</p>