Hello,
I am trying to download a dtaframe as csv file but when I press download button, I come up with an html file. Could you please help me to download a csv file? My code is below
Thank you
ui:
downloadButton(outputId = "clean_download", label = "Download cleaned data")
server:
output$clean_download <- downloadHandler(
filename = function() {
paste('clean_data.csv', sep='')
},
# content is a function with argument file. content writes the plot to the device
content = function(filename) {
write.csv(as.data.frame(train_cleaned()), filename, row.names=FALSE)
}
)