문제

I would like to get output of below into a html string.

library(rCharts)  
p2 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'scatterChart')
p2$xAxis(axisLabel = 'Weight')
p2$chart(size = '#! function(d){return d.gear} !#')
html <- p2$print()
html
NULL

How to get the complete html file which gets launched into a string.

도움이 되었습니까?

해결책

You can capture the html as a string using the render method

html <- p2$render()
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top