17 September 2014

R Sweave and R Markdown

Dear all,

This post was first posted on my G+ page.

So here are the sidekicks of R:
  • R markdown (Rmd): makes html, pdf, docx file 
  • R pres: makes html presentation file
  • R Sweave: makes LaTeX file 


_R Sweave_ is just like LaTEx, but with Sweave.sty style. If you are familiar with it, type your Latex text under the default header. Make an additional header lines if you prefer (called YAML header).

But if you don't familiar with LaTeX, I suggest you use the _R markdown_. It will render a LaTeX like doc, as it is also using the same LaTeX compilers.

It's an easy and straight forward markup language and I'm sure Rmd (RMarkdown) will evolves rapidly to fit every needs of reproducible research. At this point one of the downside of Rmd is, it only builds table of content in html format. Without additional script you can't insert toc in pdf or docx format. 

However, you can make a presentation directly from R studio by using _New "R pres" file_. The output format is *.Rpres and HTML. Or you can use Rmd format to make pdf-based presentation via clicking New "Rmd file". The Rmd presentation uses preinstalled "beamer" or "ioslide" template. You'll just need to call the template in the YAML header. 

You'll never leave R studio interface once you learn those tools.

Good luck,
Erwin


#rstats, #markdown, #rsweave

No comments: