Reputation: 356
Any suggestions on how to use R to present .ppt slides. I am giving a presentation and instead of switching back and forth between PowerPoint and R I'd like to be able to present some .ppt slides within R itself. I've seen lots of talk about going from R to PowerPoint but not much for going the other way.
Thoughts?
Upvotes: 0
Views: 491
Reputation: 10695
You can use the package ReporteRs:
library( ReporteRs )
pptx.file = "presentation.pptx"
# Creation of doc, a pptx object (default template)
doc = pptx( )
doc = addSlide( doc, "Two Content" )
# add into doc first 10 lines of iris
doc = addTitle( doc, "First 10 lines of iris" )
doc = addTable( doc, iris[1:10,] )
# add text with stylename "Normal" into doc (and an empty line just before)
doc = addParagraph( doc, value = c("", "Hello World!"), stylename = "Normal" )
doc = addSlide( doc, "Title and Content" )
# add a plot into doc
doc = addPlot( doc
, function() plot( rnorm(10), rnorm(10) )
)
# write the doc
writeDoc( doc, pptx.file )
Upvotes: 2
Reputation: 4732
Maybe the question "How to embed a shell and browser into a presentation?" is a good start.
I think once you got a browser in powerpoint you are pretty free to work with R.
Upvotes: 1
Reputation: 1919
Do you have to work with .ppt? Otherwise you could look into packages such as knitr
which are meant to facilitate dynamic reports with R
.
Upvotes: 1
Reputation: 96947
If you use Mac OS X, perhaps you can use AppleScript to control both R and PowerPoint. (If you use Windows, there might be a similar scripting option that you could research.)
Upvotes: 0