可以在Github Pages上托管交互式R Markdown文件吗? [英] Is it possible to host interactive R Markdown files on Github Pages?

查看:341
本文介绍了可以在Github Pages上托管交互式R Markdown文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说,我想在交互式R Markdown文件(意味着它里面嵌入了Shiny应用程序)的Github Pages上创建帖子。这可能在Github Pages中完成吗?如果是这样,我该怎么做;如果没有,什么是最好的(免费)方式来托管交互式RMD / Shiny页面?

解决方案

尽管无法托管在Github页面上完全成熟的Shiny应用程序(事实上,正如@Gregor所建议的,shinyapps.io对此非常有用),Shiny的开发人员一直致力于通过



(Live version: Github pages htmlwidget demo



对于更复杂的交互,包括完全在客户端的小部件之间的通信,请查看UserR的 Joe Cheng最近的串扰演示! 2016年。


As the title says, I would like to create posts on Github Pages that are interactive R Markdown files (meaning that it has Shiny apps embedded in it). Is this possible to do in Github Pages? If so, how can I do it; and if not, what's the best (free) way to host interactive RMD/Shiny pages?

解决方案

While it's not possible to host fully-fledged Shiny apps on Github pages (Indeed, as @Gregor suggested, shinyapps.io is useful for this), the devs for Shiny have been working to make some of the functionality run completely on the client-side via htmlwidgets.

Here is a simple example running on Github pages:

README.Rmd

## Example of displaying htmlwidgets on a Github pages site

```{r}
# Source: http://www.htmlwidgets.org/showcase_plotly.html
library(plotly)
p <- ggplot(data = diamonds, aes(x = cut, fill = clarity)) +
            geom_bar(position = "dodge")
ggplotly(p)
```

Rendered HTML

(Live version: Github pages htmlwidget demo)

For more complex interactions, including communicating between widgets entirely on the client-side, check out Joe Cheng's recent crosstalk demo from UserR! 2016.

这篇关于可以在Github Pages上托管交互式R Markdown文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆