Reputation: 11762
I started to play with the ReporteRs
package and hanging at a simple problem. I am trying to get a specific format for ma slides, for example to present on a 1280x1024 projector without any bars... But the slides created by ReporteRs
have strange dimensions. Is there a way to set the size of the slides somehow?
Here is the example code:
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")
Upvotes: 0
Views: 147
Reputation: 11762
I guess I just figured it out on my own. I saved an empty PowerPoint document with the expected ratios as template.pptx
and used this when using function 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")
Upvotes: 1