[ESS] insert result in the current buffer?

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Wed Aug 29 20:29:15 CEST 2012


> my usual workflow is to keep everything I ever type in a file-bound
> buffer and send stuff to the *R* buffer using C-c C-p or C-c C-j.
> sometimes I want to copy the result from *R* to the current buffer.
> I wish there were either
>
> 1. a separate command which would send stuff to *R* and then copy *R*
> output into the current buffer OR
>
> 2. C-u before an eval command would do that OR
>
> 3. a separate command which would copy the last output from *R* into the
> current buffer
>
> Any chance this is already available?

Have you seen org mode + babel?

e.g. you have code blocks embedded in an org mode document; you can then
C-c C-c on a code block to get it eval'ed, and any results are then
copied back underneath the code block.

* Intro

Here is a small document

#+BEGIN_SRC R
rnorm(5)
#+END_SRC


If I then hit C-c C-c within the code block I get the following added
after the END_SRC line.


#+RESULTS:
|  -1.30888033454414 |
| -0.541601047763267 |
|  0.599283247849955 |
|  -1.89211390846904 |
|   1.20167199136682 |

http://orgmode.org/worg/org-contrib/babel/uses.html

Stephen



More information about the ESS-help mailing list