Downloading png from Shiny (R)

A workaround for this strange scenario was discussed on the shiny-discuss google group. What you can do is simply change your reactive plotInput statement into a normal function. Not sure why downloadHandler doesn't play nice with reactive objects.

# change
plotInput <- reactive({...})

# into this
plotInput <- function(){...}

You can also remove the print statement in the downloadHandler call:

output$downloadPlot <- downloadHandler(
      filename = "Shinyplot.png",
      content = function(file) {
        png(file)
        plotInput()
        dev.off()
      })