How can I use Emacs ESS mode with R markdown?

David LeBauer picture David LeBauer · Apr 23, 2013 · Viewed 14.4k times · Source

Is there a way to configure Emacs so that it recognizes (and allows execution of) R code chunks within R markdown (.Rmd) files similar to the way it recognizes code chunks in .Rnw (Sweave) or .org (org-mode) files?

Answer

Brian Diggs picture Brian Diggs · Apr 23, 2013

polymode is being developed which does/will allow you to write markdown with R chunks (for processing with knitr).

Instructions for setting up polymode+rmarkdown are in the README

It is not yet done, but is progressing. See also this discussion on the ess-help mailing list (gmane archive|mailing list archive)


Update: polymode has been released on MELPA, simplifying the installation process by using emacs' existing package mechanism. See the announcement on the ESS mailing list here.