尝试在powerpoint模板上添加绘图时,R崩溃

尝试在powerpoint模板上添加绘图时,R崩溃,r,powerpoint,plotly,reporters,R,Powerpoint,Plotly,Reporters,我使用R和库Shining开发了一个仪表板,其中显示了一些不同的图表。这些不是静态图表,但它们是根据一些过滤器动态生成的,您可以通过一些botton等设置过滤器 下一步,我现在正在做的是创建一个powerpoint报告,包括我以前生成的图表。到目前为止,我得到了这段代码: report <- pptx(template = 'report_template.pptx') report <- addSlide(report,"report_layout") slide.layouts

我使用R和库Shining开发了一个仪表板,其中显示了一些不同的图表。这些不是静态图表,但它们是根据一些过滤器动态生成的,您可以通过一些botton等设置过滤器

下一步,我现在正在做的是创建一个powerpoint报告,包括我以前生成的图表。到目前为止,我得到了这段代码:

report <- pptx(template = 'report_template.pptx')
report <- addSlide(report,"report_layout") 
slide.layouts(report)
slide.layouts(report, "report_layout")
report <- addPlot(report, function() print(p))
writeDoc(report, "example_report.pptx")
我在一篇类似的帖子中找到了一些东西,但到目前为止还没有解决


有人知道怎么回事吗?提前谢谢

ReporteRs
不支持HTMLWidget<代码>添加绘图使用基本绘图命令、ggplot2、栅格和晶格。

谢谢@David Gohel。这是否意味着
ReporteRs
无法使用
plotly
图表?但是,它应该与
ggplot2
one一起工作,对吗?还有一件事,我是否为函数
addPlot
使用了正确的sintax??因为我看到一些文档是这样使用的:
report@LuisCano plotly图表是HTMLWidget,而不是图形设备(arg,它很复杂…)。是的,我现在明白了。。。然而,我也尝试了一些ggplot2图表,但我无法使其工作。该图表的代码如下:
p7
p <- plot_ly(agregado_cedex(), labels = ~Escalado, values = ~Total,type = "pie",
          text = ~Total, width = 500, height = 250, hoverinfo = "none") %>% config(displayModeBar = FALSE) %>%
layout(title = "Desglose incidencias", showlegend = TRUE,
       xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
       yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
Warning: Error in .jcall: javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.]