R Shiny下载.RData

时间:2019-02-11 13:06:36

标签: r shiny

如何允许闪亮应用程序的用户下载反应式的.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]

0 个答案:

没有答案
相关问题