To write a code block in a
.org file, you can simple type
followed by TAB key. Then a skeleton like the following is
All you need to do next is type a single letter
R in the header and
begin typing R code:
## Edit Your R Code Here.
x <- rnorm(100)
I recommend you to edit R code in ESS (Emacs Speaks Statistics) mode
by typing "C-c '" (i.e. C-c and single quote) within the code block,
which brings up a separate window with ESS enabled. After editing, you
can type "C-c '" again to return to the main file buffer.
Once you finish writing the code, you can execute them immediately by
C-c C-c and see the R output being inserted into the
document. Alternatively, you can press
C-c C-o to see the R output
in a separate window.
To generate (export to) HTML document, press
C-c C-e b. Note other
document options are available upon pressing