Sweave

Sweave is a function that was written by Friedrich Leisch for the statistical software R and is implemented there in package utils. Sweave creates a dynamic link between R and LaTeX. LaTeX is a software system to use the TeX text sentence can be written with the such as scientific texts.

By Sweave linking R code and LaTeX commands is enabled. During the term of the R program the selected R issues with the LaTeX commands can be combined into a LaTeX file.

In the analysis of data often statistical programs such as R can be used. Here, tables, graphs and statistics can arise that are to be used in a publication. If a large number of analytical results has arisen, it is very tedious to insert the desired analysis data (possibly by hand) in the document to be created. With Sweave the analysis results created in R can be automatically included in the LaTeX document.

Sweave can in short be described as " Report Generator ". The final LaTeX document contains both the continuous text and R code and selected R- spending. Those instructions and the expenses that will eventually be incorporated into the LaTeX document can be selected by specifying various options. The document is therefore easily upgradable, for example, when data is changed or other calculations to be carried out.

The advantage of Sweave is not only the automatic insertion of analytical results in a LaTeX document but also easy to modify the target document when changing calculations or data.

By posting program code the procedure for the calculations performed, the statistics compiled and graphics etc. of third parties can be better understood. This allows the results, provided the data are available, can be easily reproduced and verified.

Approach with Sweave

First, a LaTeX file is created in which, by

OPTIONS << >> =

R statements

@

R- commands are inserted. Specifying multiple options enables the R output to control within the LaTeX document.

The file can be converted within R with the Sweave command (. ) Into a translatable LaTeX file. The R- instructions and the R output is converted into LaTeX commands. The generated file can be processed with the help of various LaTeX compiler on. Thus it can be created, for example with pdflatex, a PDF file.

757334
de