【发布时间】:2015-02-21 21:02:35
【问题描述】:
首先,请原谅我的英语,其次我读过:
这样做,我还是有问题
我安装 rCharts 做
安装 rCharts
install.packages("devtools")
library("devtools")
install_github("ramnathv/rCharts")
library("knitr")
如果我有 .Rmd 之类的
test.Rmd
```{r ,results='asis', comment= NA, echo=FALSE}
library(rCharts)
tab2 <- dTable(as.data.frame(summary(cars)))
# tab2$show('inline', include_assets= TRUE, cdn= TRUE)
tab2$print('chart2', include_assets= TRUE, cdn= TRUE)
```
当我跑步时
knit2html(input = 'test.Rmd', output = 'test.html')
test.html 不呈现(我尝试使用tab2$show 和tab2$print)。但是,如果我用编辑器打开 test.html,则可以阅读以下内容
<p><link rel='stylesheet' href=//ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css></p>
<script type='text/javascript' src=//code.jquery.com/jquery-1.10.2.min.js></script>
<script type='text/javascript' src=//ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js></script>
这似乎是不正确的,因为一开始每个src 或href 都没有http:,所以我把http: 放在那个改成
<p><link rel='stylesheet' href=http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/css/jquery.dataTables.css></p>
<script type='text/javascript' src=http://code.jquery.com/jquery-1.10.2.min.js></script>
<script type='text/javascript' src=http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js></script>
在此之前,test.html 会渲染!!。所以我不知道我是否错过了一个参数或者这是一个错误,请帮助我
【问题讨论】:
标签: r jquery-datatables knitr rcharts