通常格式如下所示
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()
}
})
所以我收到了这条消息
错误:无法强制将类型'封闭'强制转换为“字符”类型的向量
现有的帖子没有帮助我,因为我继续得到这个错误,并且该功能在下载部分之外工作,我是否需要添加一个保存小部件或什么?
R shiny error: Cannot coerce type 'closure' to vector of type 'double'
R error: cannot coerce type 'closure' to vector of type 'double'