I would like to include a download button in my flexdashboard, however shiny::downloadButton does not render while shiny::downloadLink does:
title: "Sidebar download button"
runtime: shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
library(flexdashboard)
Column {.sidebar}
cars <- data("cars")
# renders
shiny::downloadLink(outputId = "save_link",
label = "Save cars.rds")
output$save_link <- downloadHandler(
filename = function() {"cars.rds"},
content = function(file) {
saveRDS(cars, file)
}
)
# does not render
shiny::downloadButton(outputId = "save_button",
label = "Save cars.rds")
output$save_button <- downloadHandler(
filename = function() {"cars.rds"},
content = function(file) {
saveRDS(cars, file)
}
)
Any help would be appreciated