<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/processing-rmarkdown-documents-with-eclipse-and-statet/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://lukemiller.org/index.php/2017/10/processing-rmarkdown-documents-with-eclipse-and-statet/"> R-project – lukemiller.org</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>Processing R markdown (Rmd) documents with Eclipse/StatET external tools requires a different setup than processing ‘regular’ knitr documents (Rnw). I was having problems getting the whole rmarkdown -> pandoc workflow working on Eclipse, but the following fix seems to have resolved it, and I can generate Word or HTML documents from a single .Rmd file with a YAML header (see image below).</p>
<div class="wp-caption"><a rel="nofollow" href="https://i1.wp.com/lukemiller.org/wp-content/uploads/2017/10/Rmd_for_docx.png" target="_blank"><img sizes="(max-width: 300px) 100vw, 300px" src="https://i2.wp.com/lukemiller.org/wp-content/uploads/2017/10/Rmd_for_docx-300x120.png?resize=300%2C120" alt="" class="wp-image-2396" data-recalc-dims="1"></a>
<p class="wp-caption-text">A .Rmd document with YAML header set to produce a Microsoft Word .docx output file.</p>
</div>
<p>For starters, I open the Run > External Tools > External Tools Configurations window. The Rmarkdown document is considered a type of Wikitext, so create a new Wikitext + R Document Processing entry. To do that, hit the little blank-page-with-a-plus icon found in the upper left corner of the window, above where it says “type filter text”. </p>
<div class="wp-caption"><a rel="nofollow" href="https://i0.wp.com/lukemiller.org/wp-content/uploads/2017/10/minimal_working_yaml_1.png" target="_blank"><img sizes="(max-width: 300px) 100vw, 300px" src="https://i1.wp.com/lukemiller.org/wp-content/uploads/2017/10/minimal_working_yaml_1-300x158.png?resize=300%2C158" alt="" class="wp-image-2397" data-recalc-dims="1"></a>
<p class="wp-caption-text">Using the Auto (YAML) single-step preset.</p>
</div>
<p>Enter a name for this configuration in the Name field (where it says knitr_RMD_yaml in my image above). I then used the Load Preset/Example menu in the upper right to choose the “Auto (YAML) using RMarkdown, single-step” option. This processes your .Rmd document directly using the rmarkdown::render() function, skipping over a separate knitr::knit() step, but the output should look the same. </p>
<p>Next go to the “2) Produce Output” tab (you are skipping over the “1) R-Weave” tab because you chose the 1-step process). By default the entry in the File field here was causing errors for me. The change is pictured below, so that the File entry reads <code>&quot;${file_name_base:${source_file_path}}.${out_file_ext}&quot;</code>. This change allowed my setup to actually find the .Rmd and output .md files successfully, so that the .md document could then be passed on to pandoc. </p>
<div class="wp-caption"><a rel="nofollow" href="https://i0.wp.com/lukemiller.org/wp-content/uploads/2017/10/minimal_working_yaml_2.png" target="_blank"><img sizes="(max-width: 300px) 100vw, 300px" src="https://i1.wp.com/lukemiller.org/wp-content/uploads/2017/10/minimal_working_yaml_2-300x178.png?resize=300%2C178" alt="" class="wp-image-2398" data-recalc-dims="1"></a>
<p class="wp-caption-text">Modify the File entry from the default so that instead reads the same as what’s pictured here.</p>
</div>
<p>This all assumes that you’ve previously downloaded and installed pandoc so that it can be found on the Windows system $PATH. </p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://lukemiller.org/index.php/2017/10/processing-rmarkdown-documents-with-eclipse-and-statet/"> R-project – lukemiller.org</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 rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/JiYSc91mxJk" height="1"></a></div>