how do you publish rCharts with knitHTML

左心房为你撑大大i 提交于 2020-01-07 03:56:07

问题


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?


回答1:


See - Ramnath answer.

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.

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)
```


来源:https://stackoverflow.com/questions/33288134/how-do-you-publish-rcharts-with-knithtml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!