Code Externalization

1 · Yihui Xie · Dec. 7, 2011, midnight
You do not have to put the R code in the input document; with knitr, you can separate your input document with the R script (think the reverse of Stangle). There are several advantages of separating the main document with the R script(s), e.g., R code can be reusable across several documents, and you can run the R code continuously in a separate file (if you embed the code in the document, you often have to jump through texts); this feature is especially useful for LyX users, and it saves a huge...