Academic

Org R Sandbox

2020-05-25
Meta, Academic

This post presents the workflow of interacting with R in org mode. I am mainly seeking three functions in this workflow: automatic output; persistent R session across multiple source blocks; ability to present both codes and outputs. Preparation # org-babel for executing and tangling source blocks ESS for interacting directly with R in emacs through the inferior R process Instruction # set up proper sub-tree/buffer header arguments, for this blog post I used sub-tree header arguments: :header-args:R: :session *R* :exports both :eval no-export run org-bable-execute-src-block (or on sub-tree/buffer level) to produce outputs in the text area Example # Plot output # For the following code block, I used the source block header arguments #+begin_src R :results output graphics file :file test. ...