Generating Report from Runtime: Shiny Flexdashboard

I am trying to generate a html report from a runtime Shiny flexdashboard app. I'm running into 2 issues:

  1. when I use the params feature example, I have no idea how to select the parameters,
  2. when I use the other example where it seems I don't need to pass parameters it produces a rmd document but pandoc doesn't work to convert it.

I'd rather use option 2. any ideas? Here is the error I'm getting:

This is the chunk I'm using for download report:

output$report <- downloadHandler(
    filename = function() {
      paste('my-report', sep = '.', switch(
        input$format, PDF = 'pdf', HTML = 'html', Word = 'docx'

    content = function(file) {
      src <- normalizePath('report.Rmd')

      # temporarily switch to the temp dir, in case you do not have write
      # permission to the current working directory
      owd <- setwd(tempdir())
      file.copy(src, 'report.Rmd', overwrite = TRUE)

      out <- render('report.Rmd', switch(
        PDF = pdf_document(), HTML = html_document(), Word = word_document()
      file.rename(out, file)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.