title: knitr: include figures in report *and* output figures to separate files
body: <p>Not only would I like my figures to appear in my knitr-generated report, but I would also like to output them to separate files, too. To do this, I have included code like the following:</p>
  
  <pre><code>```{r}
    #Plot figure in report
    plot(x,y)
  
    #Plot figure in file
    pdf(file="MyFig.pdf")
    plot(x,y)
    dev.off()
  ```
  </code></pre>
  
  <p>This works fine, but I expect there's a more elegant solution for this already built into knitr. Is there a chunk option or something similar that achieves the same results?</p>