Shiny R Markdown



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.

Shiny App R Markdown

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.

Shiny And R Markdown

Shiny

What Is R Markdown

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 supports a reproducible workflow for dozens of static and dynamic output formats including HTML, PDF, MS Word, Beamer, HTML5 slides, Tufte-style handouts, books, dashboards, shiny applications, scientific articles, websites, and more. Shiny and R Markdown default to Bootstrap 3 and will continue to do so to avoid breaking legacy code. Serve as a general foundation for Shiny and R Markdown extension packages. Extensions such as flexdashboard, pkgdown, and bookdown already fully support bslib ’s custom theming capabilities. Rmarkdown is useful tool for generating data-driven documents in the R environment. Given that markdown documents can be rendered to several formats (html, docx, etc.), you can use.Rmd files as a substitute for shiny UIs. In other words, you can write in Rmarkdown and let the shiny server render your file (s) into HTML documents.