在 R 中创建具有专业外观的 Powerpoint [英] Creating Professional Looking Powerpoints in R
问题描述
有没有使用 R 中的数据和 ReporteRs 等软件包生成完整 Powerpoint 的好方法?我有大约 900 张幻灯片要创建.我们的分析师目前遵循这条道路:
Is there a good way to use data from R and a package like ReporteRs to generate complete Powerpoints? I have about 900 slides to create. Our analysts currently follow this path:
DB --> SAS --> CSV --> PPTX(嵌入式图形)(x900 次)
DB --> SAS --> CSV --> PPTX (embedded graphics) (x900 times)
这是手动操作,容易出错且速度慢.
This is manual, open to lots of errors and slow.
理想情况下,我更喜欢:
Ideally, I would prefer:
DB --> R + ReporteRs --> PPTX (x1 time)
DB --> R + ReporteRs --> PPTX (x1 time)
问题是 2 倍的.首先,我们的客户(不合理地)更喜欢 PPTX,而不是 Web 甚至 PDF 格式.其次,R 图形无法在 PPTX 中进行编辑,并且有时尺寸/格式不理想,尤其是在轴文本大小方面.那么有没有办法使用 R 来创建可编辑的 Powerpoint 图形、超链接目录等? 如果不是这样,至少有 一套好的 ggplot2 模板可以与像样的 PPTX 一起使用演示文稿格式?
The issue is 2-fold. First, our clients (unreasonably) prefer PPTX over a web or even PDF format. Second, R graphics cannot be edited in PPTX, and are sometimes not ideally sized/formatted, especially in terms of axis text sizes. So is there a way to use R to create editable Powerpoint graphics, hyperlinked tables of contents, etc? If not that, is there at least a good set of ggplot2 templates to use with decent PPTX presentation formatting?
推荐答案
您可以使用我刚刚在 CRAN 上推出的新 export
包轻松导出到本地 Office 中的 Office (Word/Powerpoint)矢量格式,生成完全可编辑的图形,请参阅https://cran.r-project.org/web/packages/export/index.html 和https://github.com/tomwenseleers/export
You can use my new export
package that just came out on CRAN to easily export to Office (Word/Powerpoint) in native Office vector format, resulting in fully editable graphs, see
https://cran.r-project.org/web/packages/export/index.html and
https://github.com/tomwenseleers/export
例如:
install.packages("export")
library(export)
?graph2ppt
?graph2doc
library(ggplot2)
qplot(Sepal.Length, Petal.Length, data = iris, color = Species,
size = Petal.Width, alpha = I(0.7))
graph2ppt(file="ggplot2_plot.pptx", width=7, height=5)
graph2doc(file="ggplot2_plot.docx", width=7, height=5)
这篇关于在 R 中创建具有专业外观的 Powerpoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!