Creating an interactive report with Shiny
This recipe gives you a perfect tool for sharing analysis results with third parties.
Interactive reports are electronic documents enriched by Shiny functionalities, giving the user the ability to change the assumptions on which analyses are based and consequently changing the document's output.
You should now be comfortable with your analysis, autonomously answering questions that arise while reading.
How to do it…
Create a Shiny document:
Remove the default content
yaml
parameters.Add a
setup
chunk:```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ```
Embed your Shiny app:
```{r tabsets, echo=FALSE} shinyAppDir( "app.R", options = list( width = "100%", height = 550 ) ) ```
Add an input panel and a related plot output:
```{r eruptions, echo=FALSE} inputPanel( selectInput("selected_species", label = "iris species to plot", choices = c("virginica","setosa","versicolor"), selected = "versicolor") ) data <- reactive...