Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

1.6.9.3.7: R and reporting

( \newcommand{\kernel}{\mathrm{null}\,}\)

Literal programming, the idea of famous Donald Knuth, is the way to interleave the code and explanatory comments. Resulted document is the living report: when you change your code or your data, it will be immediately reflected in the report. There many ways to create living reports in R using various office document formats but the most natural way is to use LaTeX. Let us create the text file and call it, for example, test_sweave.rnw:

On the next step, this file should be “fed” to the R:

Code 1.6.9.3.7.1 (R):

Sweave("test_sweave.rnw")

After that, you will have the new LaTeX file, test_sweave.tex. Finally, with a help of pdfLaTeX you can obtain the PDF which is shown on the Figure C.8.1.


1.6.9.3.7: R and reporting is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

  • Was this article helpful?

Support Center

How can we help?