Hello,
I created some table / data frame in Shiny.
Now I wanted to download them in xlsx file into a local directory.
I found some simple code:
It doesn't seem like it's working. Please advise ?
ui <- fluidPage(
downloadButton("dl", "Download")
)
server <- function(input, output) {
data <- mtcars
output$dl <- downloadHandler(
filename = function() {paste(data, "ae.xlsx", sep="")},
content = function(file) {write.table(data, file, sep = sep,row.names = FALSE)}
)
}
shinyApp(ui, server)
<sup>Created on 2018-11-18 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)</sup>