我想弄清楚如何从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
如何实现这一目标的任何建议?