我开始使用ReporteRs包,并遇到了一个简单的问题。我正在尝试获取一种特定的幻灯片格式,例如,在没有任何条的1280x1024投影仪上演示。但是ReporteRs制作的幻灯片有奇怪的尺寸。有没有办法设置幻灯片的大小?
示例代码如下:
require(ReporteRs)
require(ggplot2)
myplot <- qplot(Sepal.Length, Petal.Length,
data=iris, color=Species,
size=Petal.Width, alpha=I(0.7))
# Create a new document
mydoc <- pptx(title="EVG demo")
mydoc <- addSlide(mydoc, "Content with Caption")
mydoc <- addTitle(mydoc, "Vector graphics format versus raster format")
mydoc <- addPlot(mydoc, function() print(myplot), vector.graphic=TRUE)
mydoc <- addPlot(mydoc, function() print(myplot), vector.graphic=FALSE)
writeDoc(mydoc, file="EVG_example.pptx")发布于 2016-10-19 20:38:45
我想我是自己想出来的。我将一个具有预期比率的空PowerPoint文档保存为template.pptx,并在使用函数pptx()时使用它。
myplot <- qplot(Sepal.Length, Petal.Length,
data=iris, color=Species,
size=Petal.Width, alpha=I(0.7) )
# Create a new document
mydoc <- pptx(title="EVG demo", template='template.pptx')
mydoc <- addSlide(mydoc, "Content with Caption")
mydoc <- addTitle(mydoc, "Vector graphics format versus raster format")
mydoc <- addPlot(mydoc, function() print(myplot), vector.graphic=TRUE)
mydoc <- addParagraph(mydoc, 'test test 1 2 3')
writeDoc(mydoc, file="EVG_example.pptx")https://stackoverflow.com/questions/40131480
复制相似问题