如何在博克目中嵌入闪亮的应用程序?

Antoine Soetewey 2020-01-07 2 minute read

如果您已开发并部署了一个闪亮的应用程序并希望将其嵌入博客中,请按照下列步骤操作:

  1. 像往常一样创建一个新帖子
  2. add runtime: shiny (and output: html_document if it is not already included) in the YAML metadata
  3. 在帖子的正文中插入以下HTML代码:
<iframe height="800" width="100%" frameborder="no" src="//antoinesoetewey.shinyapps.io/statistics-201/"> </iframe>

You should change the URL with the URL of your deployed Shiny app (after src=, do not forget that the URL should start with http:// or // and should be surrounded by "). Moreover, you can modify the height, the width and include or not a frame border with the corresponding tags.

这是我的闪亮应用程序中的一个结果的例子(关联 to the app):


请注意,如果它达到月度使用限制,应用程序可能无法正常工作。如果是这种情况,请稍后再试。

Here is the entire .Rmd code in case you would like to use it for your own website:

If you encounter an issue, try loading the following packages in the body of your new post: shiny, widgetframe (you can load a package with the command library(widgetframe)). If one of the package is not installed yet, you can do it with the command install.packages("widgetframe").

我希望这篇文章有助于您在博客网站中嵌入闪亮的应用程序。

一如既往,如果您有问题或与本文所涵盖的主题相关的建议,请将其添加为评论,以便其他读者可以从讨论中受益。



喜欢这篇文章?

获取更新 每次发布新文章。
任何垃圾邮件都没有任何垃圾邮件。
分享: