<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/reporters-manager-friendly-word-or-powerpoint-documents-created-with-r/"></div></div><div><a data-url="https://www.r-bloggers.com/reporters-manager-friendly-word-or-powerpoint-documents-created-with-r/" data-counturl="https://www.r-bloggers.com/reporters-manager-friendly-word-or-powerpoint-documents-created-with-r/" data-count="horizontal" data-text="ReporteRs: Manager-friendly Word or Powerpoint documents created with R" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2016/10/reporters.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>As much as we data scientists would like to work solely in R, there inevitably comes the time when our managers or customers want to see the fruits of our labours as a Word document or PowerPoint presentation. And not just any old document: it needs to be in the official corporate template, and will no doubt go through a series of back-and-forth revisions — marked up directly in the document — before it's considered final.</p>
<p>R has several options for generating Word and PowerPoint documents, notably <a target="_blank" rel="nofollow" href="http://blog.revolutionanalytics.com/2014/09/r-markdown.html">RMarkdown</a> and <a target="_blank" rel="nofollow" href="http://blog.revolutionanalytics.com/2012/11/create-elegant-interactive-presentations-from-r-with-slidify.html">Slidify</a>. But in both these cases, R is in the driver's seat, and if you want to make any changes to the document that will persist through changes to the R code, you'll need to make those changes with R. And as <a target="_blank" rel="nofollow" href="http://www.mango-solutions.com/wp/2016/10/why-i-would-rather-use-reporters-than-rmarkdown/">Aimee</a><a target="_blank" rel="nofollow" href="http://www.mango-solutions.com/wp/2016/10/why-i-would-rather-use-reporters-than-rmarkdown/"> Gott from Mango points out</a>, that doesn't work so well if the document will go through a review cycle with non-R users. (It's also quite tricky to use a corporate template with these solutions.)</p>
<p>That's where <a target="_blank" rel="nofollow" href="http://davidgohel.github.io/ReporteRs/index.html">ReporteRs</a> (created by David Gohel) comes in. While you can use ReporteRs to create complete documents and presentations programatically, one of the most useful features is to be able to <em>insert</em> R output (numbers, tables, and charts) into an existing document. This lets you use Word or Powerpoint as usual to style the document and build the narrative, and use R to insert the scientific results in the appropriate places.</p>
<p>For <a target="_blank" rel="nofollow" href="http://davidgohel.github.io/ReporteRs/word.html">Word documents</a>, simply place a <a target="_blank" rel="nofollow" href="https://support.office.com/en-US/article/Add-bookmarks-in-a-Word-document-or-Outlook-message-480a66e1-ae9e-4e53-a2c6-a726ec86298d">named bookmark</a> in the document where you'd like output from R to go. Then, you'll use that document and bookmark name in a call to <a target="_blank" rel="nofollow" href="https://www.rdocumentation.org/packages/ReporteRs/versions/0.8.6/topics/addParagraph">addParagraph</a> (to insert text, say a P-value or other result) or <a target="_blank" rel="nofollow" href="https://www.rdocumentation.org/packages/ReporteRs/versions/0.8.6/topics/addImage">addImage</a> (to insert a static PNG or JPG image). You can even use <a target="_blank" rel="nofollow" href="https://www.rdocumentation.org/packages/ReporteRs/versions/0.8.6/topics/addPlot">addPlot</a>, to insert an R graphic that can be edited directly within the Word or Powerpoint file using the Drawing toolba: vary useful for pre-publication annotations, although such changes will be overwritten next time you generate the document. For tabular output like data frames, use the <a target="_blank" rel="nofollow" href="https://www.rdocumentation.org/packages/ReporteRs/versions/0.8.6/topics/addFlexTable">addFlexTable</a> function to insert a table, which formats it nicely and gives lots of <a target="_blank" rel="nofollow" href="http://davidgohel.github.io/ReporteRs/FlexTable.html">options for layout</a> like merging cells and coloring rows and columns.<a target="_blank" rel="nofollow" href="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8a89e69970b-pi"><img title="Table" alt="Table" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8a89e69970b-800wi" border="0"></a></p>
<p>For Powerpoint presentations, first start with a PowerPoint presentation in your chosen template, and create blank slides where you'd like to insert R output. You can then replace those slides by indicating the slide number in the <a target="_blank" rel="nofollow" href="https://www.rdocumentation.org/packages/ReporteRs/versions/0.8.6/topics/addSlide">addSlide</a> function. While you can only insert complete slides, ReporteRs gives you plenty of flexibility in the layout of the slides.</p>
<p>ReporteRs is an open source pacakge available for <a target="_blank" rel="nofollow" href="https://mran.microsoft.com/package/ReporteRs/">download on CRAN</a>. For more details on ReporteRs and how to use it, check out its homepage at the link below.</p>
<p>David Gohel: <a target="_blank" rel="nofollow" href="http://davidgohel.github.io/ReporteRs/">ReporteRs</a></p>
</div>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/reporters-manager-friendly-word-or-powerpoint-documents-created-with-r/"></div></div><div><a data-url="https://www.r-bloggers.com/reporters-manager-friendly-word-or-powerpoint-documents-created-with-r/" data-counturl="https://www.r-bloggers.com/reporters-manager-friendly-word-or-powerpoint-documents-created-with-r/" data-count="vertical" data-text="ReporteRs: Manager-friendly Word or Powerpoint documents created with R" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.revolutionanalytics.com/2016/10/reporters.html"> Revolutions</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/vmtCPL2pqbg"></a></div>