本文介绍了如何使用knitHTML发布rCharts的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在knitrHTML中发布rCharts,但一直出现此错误:
I am trying to publish rCharts in knitrHTML, I keep getting this error:
Quitting from lines 11-43 (ddd.Rmd)
Error in file(con, "w") : cannot open the connection
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> <Anonymous> -> writeLines -> file
Execution halted
这是我在降价促销中的佣金:
this is my kode within the markdown:
rPlot(cpubusy ~ datetime, color = 'machine', type = 'point', data = server)
我该如何解决?我想念什么?
How could I resolve this? what am I missing?
推荐答案
请参阅-答案.
基本上要添加rCharts
并将其呈现在knitr
中,您需要使用print
方法和include_assets = TRUE
.这将告诉knitr
添加rCharts
所需的JS
和CSS
资产.
Basically to add rCharts
and have it rendered within knitr
you need to the print
method and include_assets = TRUE
. This will tell knitr
to add the JS
and CSS
assets required for rCharts
.
还要确保您的代码块为{r results = 'asis', comment = NA}
.
Also make sure you have {r results = 'asis', comment = NA}
for your chunk.
```{r results = 'asis', comment = NA}
p <- rPlot(speed ~ dist, data = cars, type = 'point')
p$print('chart', include_assets = TRUE)
```
这篇关于如何使用knitHTML发布rCharts的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!