title: Embedding R plots in Latex via org-mode
body: <p>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.</p>
  
  <p>So far I've got this to work:</p>
  
  <pre><code>#+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}
  </code></pre>
  
  <p>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 <code>\includegraphics</code> instruction.</p>
  
  <p>Is this possible at all?</p>