I'm just getting started with org-mode and so far I love it. I've seen that it is possible to insert R in the org-mode file and execute it upon export. But I have some trouble getting org-babel (the code embedding) to generate the plot I'm interested in and embed the resulting image instead of the code or the output from running the code.
So far I've got this to work:
#+BABEL: :session *R* :results output graphics :exports both
#+begin_src R :file img.pdf :results output graphics :session *R*
hist(rnorm(100))
#+end_src
#\includegraphics{img.pdf}
But it's not as nice as it could be. First it always prompts me whether I do want to execute the R code and secondly I would like to eliminate the \includegraphics
instruction.
Is this possible at all?