1 min read

First Interactive Plot

Interactive Plot in Blogdown

Blogdown is to generate static HTML, and according a github answer by the author of Blogdwon himself, the only way to embed a interactive Shiny app is to use <iframe>.

Create a Shiny app and deploy it

The easiest way to deploy a Shiny app is to use the shinyapps.io platform. Just follow the steps from the website after you sign up, and you shiny app is deployed, in 3 steps. My first attemp is at https://riskpredictions.shinyapps.io/prob_plot/

Create an iframe block in Blogdown

Follow the steps at https://rmarkdown.rstudio.com/authoring_shiny.html

Add the code below to the end of the Rmarkdown post.

<iframe src = "https://riskpredictions.shinyapps.io/prob_plot/" frameborder="0" allowfullscreen width = 800 height = 800> </iframe>

Here it comes: