Note: The latest version of ESS now includes support for
knitr. This script is no longer necessary.
During my recent switch from vim to Emacs I discovered what a wonderful tool ESS is. It was fantastic for writing
Rnw documents using
Sweave, but seeing as I’m currently attempting another switch, from
knitr, I wanted support for that.
After a quick look at the ESS source code, I was able to write a quick script that gives ESS support for
- Download the Emacs lisp script below.
- Store it in a useful location, I stored it in the following path:
- Import the script in your
.emacsfile. My configuration is the following:Note: This snippet should be included after the code that loads ESS.
;; Add support for knit and purl (add-to-list 'load-path "~/.emacs.d/ess-knitr/") (require 'ess-knitr)
M-n r“knit” an
M-n u“purl” an