How do you save images in an R shiny function

Generally the format looks like this

output$downloadPlot <- downloadHandler
filename = function() {
  paste0(basename(file_path_sans_ext(input$filename)), "_plot", ".jpeg", sep='')
},
PLOTFUNCTION()<- function(){
   plot()

},
content = function(file) {
  if (input$clickButton != 0) {
    jpeg(file)
    PLOTFUNCTION()
    dev.off()
  } 
  else {
    return()
  }
})

so then I get this message

ERROR: cannot coerce type 'closure' to vector of type 'character'
existing posts did not help me as I continue to get this error and the function works outside of the download part, do I need add aa save widget or something?
R shiny error: Cannot coerce type 'closure' to vector of type 'double'
R error: cannot coerce type 'closure' to vector of type 'double'

链接地址: http://www.djcxy.com/p/38342.html

上一篇: 如何为套接字设置多个路由条目?

下一篇: 如何将图像保存在R闪光灯功能中