Setting up emacs org-mode babel for R on Ubuntu

I installed org-mode seperately, since I had troubles with its default setting (similar to the problems described here).

sudo apt-get install org-mode

Next I download and installed ESS

cd ~/.emacs.d/
wget http://ess.r-project.org/downloads/ess/ess-12.09-1.zip
unzip ess-12.09-1.zip
rm ess-12.09-1.zip

Finally I had to add the following lines to my .emacs file:

(add-to-list 'load-path "~/.emacs.d/ess-12.09-1/lisp")
(require 'ess-site)
(org-babel-do-load-languages
'org-babel-load-languages
'((R . t)))

and to my .Rprofile

old options(defaultPackages = c(old, "tikzDevice"))

For testing open a new file with emacs:

emacs test.org

and add the following code block:

#+begin_src R
date()
#+end_src

press C-c C-c to execute the code. See the org-mode documentation for more information.

About these ads
This entry was posted in Computer, R, Ubuntu. Bookmark the permalink.

One Response to Setting up emacs org-mode babel for R on Ubuntu

  1. You are making it too hard for yourself—I also maintain the ess package which Michael rebuilds. So the usual Ubuntu repository on CRAN also contains a current ess version, along with current R versions.

    Cheers, Dirk

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s