R, Emacs and Org-mode

Using R with Org-babel

to export a graph created by R, use the following line to start the R code:

#+begin_src R :results graphics :file lightning.png :exports both

Parameters explained:

  • :results graphics exports the results as a graphics file.
  • :file lightning.png exports the graph to a file named lightning.png
  • :exports both exports both the code and the results

to end the R code use the following line

#+end_src

R Emacs Tips

M-x R

type M-x R to start the inferior R process in an emacs buffer

History

if you start R-mode in the same directory each time and save the
session at the end of your session, then your history and session
variables will be preserved between sessions.

Category:

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.