title: How to capture R text+image output into one file (html, doc, pdf etc)?
body: <p>The task is to create a file (word, rtf, pdf, html, or whatever) that will capture the output of R (e.g: not the code that created the output), into that format (including text <strong>and</strong> images).</p>
  
  <p>The way of doing this should involve as little change to the original R script as possible.</p>
  
  <p>If I had cared only for the text or images, then I would use ?sink, or ?pdf.  But I don't know how to combine the two into one output in an easy way.</p>
  
  <p>I know there is a way to <a href="http://www.r-statistics.com/2010/05/exporting-r-output-to-ms-word-with-r2wd-an-example-session/">export R output using r2wd</a>, but it involves too much medaling in the original code for my taste (I imagine the same is true for the sweave solution, although I don't have experience with it to tell)</p>
  
  <p>Here is a sample code for future examples:</p>
  
  <pre><code>START.text.and.image.recording("output.file") # this is the function I am looking for
  x &lt;- rnorm(100)
  y &lt;- jitter(x)
  print(summary(x))
  print(head(data.frame(x,y)))
  cor(x,y)
  plot(x,y)
  print(summary(lm(y~x)))
  STOP.text.and.image.recording("output.file") # this is the function I am looking for
  </code></pre>
  
  <p><strong>Update</strong>:  I was asked way not Sweave, or other options from <a href="http://cran.r-project.org/web/views/ReproducibleResearch.html">ReproducibleResearch task view</a>.</p>
  
  <p>The reasons are:</p>
  
  <ol>
  <li>I don't (yet) know LaTeX</li>
  <li>Even knowing LaTeX, I want something with simple defaults to <strong>simply</strong> dump all the outputs together, and in order.  "simply" means - as little extra code/file management overhead as possible.</li>
  </ol>
  
  <p>I understand that something like sweave or brew are more scalable, but I am looking to see if there is a more "simple" solution for smaller projects/scripts.</p>