O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dynamic integration of Shiny with knitr

In IntegrationApp, we will illustrate the strategy to dynamically integrate the Shiny app into the Rmd file using knitr and webshot screenshot functionality to share R code of a Shiny application, while also documenting that code and showing a screenshot of the resulting app. Each time you make changes to your shiny app code, it will automatically get updated in the Rmd file along with a new screenshot without any manual intervention. First, make sure that you have the shiny and knitr packages installed. Next, install the webshot package:

install.packages("webshot")webshot::install_phantomjs()

The read_chunk() function from the knitr package gets the code from R files (ui.R and server.R) into a code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required