concept LaTeX in category R

appears as: LaTeX
R in Action, Second Edition: Data analysis and graphics with R

This is an excerpt from Manning's book R in Action, Second Edition: Data analysis and graphics with R.

Every R package follows the same set of enforced guidelines for documentation. Each function in a package must be documented in the same fashion using LaTeX, a document markup language and typesetting system. Each function is placed in a separate .R file, and the documentation for that function (written in LaTeX) is placed in a .Rd file. Both the .R and .Rd files are text files.

There are two limitations to this approach. First, the documentation is stored separately from the functions it describes. If you change the function code, you have to search out the documentation and change it as well. Second, the user has to learn LaTeX. If you thought R has a steep learning curve, wait until you start working with LaTeX!

22.3. Creating dynamic reports with R and LaTeX

LaTeX is a document-preparation system for high-quality typesetting that’s freely available for Windows, Mac, and Linux platforms. LaTeX allows you to create beautiful, complex, multipart documents, and it can convert from one type of document (such as an article) to another type of document (such as a report) by changing just a few lines of code. It’s extraordinarily powerful software and, as such, has a significant learning curve.

If you’re unfamiliar with LaTeX, you may want to read “The Not So Short Introduction to LaTeX 2e” by Tobias Oetiker et al. (http://mng.bz/45vP) or LaTeX Tutorials: A Primer by the Indian TEX Users Group (http://mng.bz/2c0O) before continuing. The language is definitely worth learning, but it will take some time and patience to master. Once you’re familiar with LaTeX, creating a dynamic report is a straightforward process.