The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Getting Started with shinyReports

Overview

The shinyReports package provides a simple way to render R Markdown reports to HTML directly within a Shiny application, displaying the result in a new browser tab and eliminating the need for users to manually download and open report files.

Create the R Markdown template

First, create your .Rmd file you want to render as a report. It must be accessible from the root directory of your application. Ensure that you output your report as a html_document within the YAML heading.

An example report.Rmd:

---
title: "My Report"
output: html_document
params:
  date: NA
---

Parameters passed from the Shiny application via renderReport() (see below) are referenced using inline R expressions, such as params$date.

Build your Shiny application

Add the reportButton() (a shiny::actionButton download wrapper) and renderReport functions to your UI and server, respectively in app.R:

library(shiny)
library(shinyReports)

ui <- fluidPage(
  reportButton("knit_report", label = "Generate Report")
)

server <- function(input, output, session) {
  renderReport(
    inputId = "knit_report",
    title = "My Report",
    rmd_file = "report.Rmd",
    params = list(date = Sys.Date())
  )
}

shinyApp(ui, server)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.