Embedding Rmarkdown in a Jekyll site

Posted on 24 Jul 2013

I'm a big fan of Rmarkdown, which I came across through the very handy R IDE, RStudio. Since I've recently converted this blog to use Jekyll, which is also markdown based, I thought I'd have a go at combining the two. There are various things around to do this, but the below, a plugin creating a new Liquid tag worked best for me.

This goes in Rmarkdown.rb in the _plugins folder for your jekyll site

You will also need the rinruby gem, and R installed and the knitr package in your default R. The easiest way to get these in place, is probably just to use RStudio, which is well worth it in any case.

You can then just put chunks of Rmarkdown in a liquid tag called Rmd and it will be processed by rinruby and knitr.

StackOverflow Flair

profile for Simon Elliston Ball at Stack Overflow, Q&A for professional and enthusiast programmers