# In server.R:
output$downloadData <- downloadHandler(
filename = function() {
paste('data-', Sys.Date(), '.csv', sep='')
},
content = function(file) {
write.csv(data, file)
}
)
# In ui.R:
downloadLink('downloadData', 'Download')
Run the code above in your browser using DataLab