R Markdown: The Definitive Guide. Chapter 19Shiny Documents. We have briefly introduced Shiny documents in Section 2.8.2. Shiny is a very powerful framework for building web applications based on R. It is out of the scope of this book to make a comprehensive introduction to Shiny (which is too big a. I try to have a Markdown document with a verbose option (i.e. Show or not the code of the page, to avoid to afraid people:D ) depending on the choice of the user (basically a radio button widget). File Name: Epic Beatdowns – Megan and Ava Destroy Him MIXED FIGHTING, LEOTARD FETISH, MIXED WRESTLING, SHINY CLOTHING, SCISSORHOLD, k2s.cc, femdom.
We have briefly introduced Shiny documents in Section 2.8.2. Shiny is a very powerful framework for building web applications based on R. It is out of the scope of this book to make a comprehensive introduction to Shiny (which is too big a topic). We recommend that readers who are not familiar with Shiny learn more about it from the website https://shiny.rstudio.com before reading this chapter.
Unlike the more traditional workflow of creating static reports, you can create documents that allow your readers to change the parameters underlying your analysis and see the results immediately in Shiny R Markdown documents. In the example shown in Figure 2.8, the histogram will be automatically updated to reflect the number of bins selected by the reader.
A picture is worth a thousand words, and a Shiny document can potentially show you a thousand pictures as you interact with it. The readers are no longer tied to the fixed analysis and conclusions in the report. They may explore other possibilities by themselves, and possibly make new discoveries or draw different conclusions.
R Markdown’s new interactive documents provide a quick, light-weight way to use Shiny. An interactive document embeds Shiny elements in an R Markdown report. The report becomes “live”, a choose your own adventure that readers can control and explore. Interactive documents are easy to create and easy to share.
Create an interactive document
To create an interactive document use RStudio to create a new R Markdown file, choose the Shiny document template, then click “Run Document” to show a preview:

Embed R code chunks in your report where you like. Interactive documents use the same syntax as R Markdown and knitr. Set echo = FALSE
. Your reader won’t see the code, just its results.
Include Shiny widgets and outputs in your code chunks. R Markdown will insert the widgets directly into your final document. When a reader toggles a widget, the parts of the document that depend on it will update instantly.
That’s it! No extra files are needed.
Note that in order to use interactive documents you should be running the latest version of RStudio (v0.98.932 or higher). Alternatively if you are not using RStudio be sure to follow the directions here to install all of the required components.
Share your document
Interactive documents can be run locally on the desktop or be deployed Shiny Server v1.2 or ShinyApps just like any other Shiny application. See the RMarkdown v2 website for more details on deploying interactive documents.
Use pre-packaged tools
Shiny Markdown Image
Interactive documents make it easy to insert powerful tools into a report. For example, you can insert a kmeans clustering tool into your document with one line of code, as below. kmeans_cluster
is a widget built from a Shiny app and intended for use in interactive documents.

You can build your own widgets with shinyApp
, a new function that repackages Shiny apps as functions. shinyApp
is easy to use. Its first argument takes the code that appears in an app’s ui.R file. The second argument takes the code that appears in the app’s server.R file. The source of kmeans_cluster
reveals how simple this is.
Be a hero
Ready to be a hero? You can use the shinyApp
function to make out of the box widgets that students, teachers, and data scientists will use everyday. Widgets can
fit models
compare distributions
visualize data
demonstrate teaching examples
act as quizzes or multiple choice questions
and more
These widgets are not made yet, they are low hanging fruit for any Shiny developer. If you know how to program with Shiny (or want to learn), and would like to make your mark on R, consider authoring a package that makes widgets available for interactive documents.
Get started!
Shiny Markdown Reactive
To learn more about interactive documents visit https://rmarkdown.rstudio.com/authoring_shiny.html.
