Elegant, flexible, and fast dynamic report generation with R
The knitr package was designed to be a transparent engine for dynamic report generation with R, solve some long-standing problems in Sweave, and combine features in other add-on packages into one package (knitr ≈ Sweave + cacheSweave + pgfSweave + weaver + animation::saveLatex
+ R2HTML::RweaveHTML
+ highlight::HighlightWeaveLatex
+ 0.2 * brew + 0.1 * SweaveListingUtils + more).
1 + 2
produces [1] 3
in an R terminal, and knitr can let the user decide whether to put 1 + 2
between \begin{verbatim}
and \end{verbatim}
, or <div class="rsource">
and </div>
, and put [1] 3
in \begin{Routput}
and \end{Routput}
; see the hooks page for detailsqplot(x, y)
directly produces the plot (no need to print()
it), and all the plots in a code chunk will be written to the output by defaultThis package is developed on GitHub; for installation instructions and FAQ’s, see README. This website serves as the full documentation of knitr, and you can find the main manual, the graphics manual and other demos / examples here. For a more organized reference, see the knitr book.