如何下载RenderDataTable的输出

时间:2016-04-07 00:10:40

标签: r shiny

我想弄清楚如何从renderDataTable下载输出

special <- renderDataTable({
    data <- sessionvalues$data
    colnames(data) <- as.vector(sapply(colnames(data),idToName))
    action <- dataTableAjax(session, data,rownames = F)
    datatable(data, rownames = F,
              options = list(dom = 'itp',
                             ajax = list(url = action)))
  }, server = TRUE)

  output$table <- special()



  output$downLoad <- downloadHandler(
    filename = function() {
      paste('Filtered data-', Sys.Date(), '.csv', sep = '')
    },
    content = function(file){
      write.csv(special(),file)
    }
  )

并显示Error in special() : argument "shinysession" is missing, with no default

如何实现这一目标的任何建议?

0 个答案:

没有答案