Site icon R-bloggers

Setting up emacs org-mode babel for R on Ubuntu

[This article was first published on Ecological Modelling... » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

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.


To leave a comment for the author, please follow the link and comment on their blog: Ecological Modelling... » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.