How to embed a Shiny app into your blog posts

[This article was first published on Albert Rapp, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Today’s a short blog post. It’s mainly for sharing a cool trick I just learned.

Here’s a simple template to incorporate your Shiny app into an HTML file. For instance, you can incorporate your shiny app into your blog post like I do here. Simply exchange the src argument by your Shiny app’s URL and then you’re good to go. Here, I use the app that I have shown you a couple of months ago.

<iframe src="https://rappa.shinyapps.io/interactive-ggplot" data-external="1" width="925px" height="800px">
</iframe>

From what I could tell, this is same code that knitr::include_app() drops. But including the iframe manually let’s you adjust the width and height of your frame. Beware that you will have to choose the dimensions large enough for your Shiny app.

To leave a comment for the author, please follow the link and comment on their blog: Albert Rapp.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)