我开始使用ReporteRs
包并挂在一个简单的问题上。我试图获得ma幻灯片的特定格式,例如在没有任何条形图的情况下呈现在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")
答案 0 :(得分:1)
我想我只是自己想出来了。我保存了一个空的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")