One of the strengths of R is its ability to help in producing documents. Sweave and knitr can work with .Rnw files, evaluating and automatically inserting the results of R code to produce a LaTeX document in a .tex file. We call this “preprocessing”, since the later steps were originally designed with the assumption that the .tex file was directly edited by the user and then processed to produce PDF or other output formats.