使用Shiny的downloadHandler导出SAS文件

时间:2019-12-19 14:49:03

标签: r shiny r-haven

我想使用.sas7bdat将数据帧导出为haven,但是我在repex中收到错误Writing failure: A provided name contains an illegal character

library(shiny)
library(haven)


ui <- fluidPage(
  downloadButton("downloadSAS", "SAS")
)

# Define server logic required to draw a histogram
server <- function(input, output) {

  output$downloadSAS <- downloadHandler(
    filename = function() {
      paste("test.sas7bdat")
    },
    content = function(file) {
      write_sas(iris, file)
    }
  )

}

# Run the application 
shinyApp(ui = ui, server = server)

我希望我缺少一个简单的解决方法?请指教!

0 个答案:

没有答案