9.5 Downloading reports

Diagram of report download functionality

We can allow the user to download a report based on their exploration of an application.

  • parameterized R Markdown is a good way to do this
  • potential parameters - filters, simulation parameters
  • specify parameters in YAML header of R Markdown document
  • key idea - call rmarkdown::render() from content argument of downloadHandler()

9.5.1 Observe this in action

  • Check out the app-download-report.R example

9.5.2 Some tips & tricks when including report download functionality:

  • .Rmd renders in working directory so copy file temporary directory before rendering.
  • .Rmd renders in current R process so consider running in separate session with e.g. callr package.