如何允许闪亮应用程序的用户下载反应式的.RData
?
ui <- fluidPage(
downloadButton("dl", "Download")
)
server <- function(input, output, session){
react <- reactive(mtcars)
output$dl <- downloadHandler(
filename = function() {
paste("data.RData")
},
content = function(file) {
save(react(), file = file)
}
)
}
shinyApp(ui, server)
以上错误:
Listening on http://127.0.0.1:5473
Warning: Error in save: object ‘react()’ not found
[No stack trace available]