在GitHub或RPubs上发布后,Slidify不会在浏览器中呈现rCharts

时间:2015-11-19 13:57:17

标签: r github github-pages rcharts slidify

我使用rCharts创建了一个slidify,并在我的计算机浏览器上正常工作,但是当我在另一台计算机上打开该文件夹时,rCharts不会出现。代码:

setwd("/home/sergio/Copy/PhDgrive/Conferences/IEA2015/IEA2015/")
require(devtools)
pkgs = c('slidify', 'slidifyLibraries')
install_github(pkgs, 'ramnathv')
install_github('rCharts', 'ramnathv')
install.packages("base64enc")
library(slidify)
library(rCharts)
library(base64enc)
author("IEA2015")
slidify("index.Rmd")
publish(user = "xhie", repo = "IEA2015")

此外,在RawGit上发布项目后,index.md无法呈现,而Here is index.Rmd也没有显示rCharts。 here

---
title       : High resolution emissions inventory for Megacity of São Paulo 
subtitle    : MetroHealth - Instituo de Estudos Avançados USP
author      : Sergio Ibarra Espinosa
job         : PhD student Meteorology IAG/USP
framework   : io2012        # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js  # {highlight.js, prettify, highlight}
hitheme     : io2012      # 
widgets     : [nvd3]             # {mathjax, quiz, bootstrap}
ext_widgets : {rCharts: libraries/nvd3}
mode        : selfcontained ,standalone#, draft
knit        : slidify::knit2slides
---

这里有一个例子,我不是rChart的代码

--- .class1 
## Passenger Cars distribution by age
### Proconve Standard - 14 years average age
```{r, results = 'asis', comment = NA, message = F, echo = F} 
require(knitr)
require(rCharts)
require(base64enc)
setwd("/home/sergio/Copy/PhDgrive/Conferences/IEA2015/IEA2015/")
emi <- read.csv("assets/files/dfsA_PROCONVE.txt")
d1 <- dPlot(
  x = "sanos", 
  y = "df_A.sA", 
  groups = "Standard_PC", 
  data = emi, 
  type = 'bar')
d1$legend( x = 60, y = 10, width = 800, height = 20, horizontalAlign = "left", orderRule = "Ancestry")
d1$show('iframesrc', cdn = FALSE)
```

我希望看到图像在其他计算机上显示的结果 enter image description here

回购邮件是here,rPubs的链接是http://www.varsanofiev.com/inside/TunTest.cs 谢谢!

1 个答案:

答案 0 :(得分:0)

您的图形iframe指的是用于渲染的本地库:

<script src="/home/sergio/R/x86_64-pc-linux-gnu-library/3.2/rCharts/libraries/dimple/js/d3.v3.js" type="text/javascript"></script>
<script src="/home/sergio/R/x86_64-pc-linux-gnu-library/3.2/rCharts/libraries/dimple/js/dimple.v2.1.0.js" type="text/javascript"></script>

所以,没有脚本,没有渲染!