downloadHandler
defined in the server
function.downloadButton(outputId, label = "Download",
class = NULL) downloadLink(outputId, label = "Download", class = NULL)
downloadHandler
is assigned to.# In server.R:
output$downloadData <- downloadHandler(
filename = function() {
paste('data-', Sys.Date(), '.csv', sep='')
},
content = function(con) {
write.csv(data, con)
}
)
# In ui.R:
downloadLink('downloadData', 'Download')
Run the code above in your browser using DataLab