I am attempting to add a simple download button to an Rmarkdown report but it seems like the button downloads the entire report and not the table of interest. For example, in my RMarkdown I have:
shiny::downloadHandler(
filename = "mtcars.csv",
content = function(file) {
write.csv(mtcars, file)
}
)
with a YAML header of:
runtime: shiny
output:
html_document:
number_sections: true
The handler generates a button but the button does not download the mtcars
data, it downloads the entire html report. I'm running rmarkdown::render
to generate the report.
Any assistance on adding download buttons to RMarkdown reports would be greatly appreciated.