Render rCharts using ReporteRs package in powerpoint

梦想与她 提交于 2020-01-16 13:18:08

问题


I can renderchart in R shiny by below code:

 output$example=renderChart2({
    p1 <- nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'multiBarChart')
    p1
    })

Now, I want the same thing in ppt. by using ReporteRs package.I have tried below code but it is not working

library(ReporteRs)
doc =pptx( )
doc <- addSlide(doc, "Two Content")
plotFunc<- function(){ nPlot(mpg ~ wt, group = 'cyl', data = mtcars, type = 'multiBarChart')
} 
doc <- addPlot(doc, fun =print, x = plotFunc)
writeDoc(doc, "r-2.pptx" )

Can someone tell me how do render rCharts in ppt.

来源:https://stackoverflow.com/questions/36548167/render-rcharts-using-reporters-package-in-powerpoint

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