RweaveExtra-package {RweaveExtra} | R Documentation |
Sweave Drivers with Extra Tricks Up their Sleeve
Description
Weave and tangle drivers for Sweave extending the standard drivers. RweaveExtraLatex and RtangleExtra provide options to completely ignore code chunks on weaving, tangling, or both. Chunks ignored on weaving are not parsed, yet are written out verbatim on tangling. Chunks ignored on tangling may be evaluated as usual on weaving, but are completely left out of the tangled scripts. The driver RtangleExtra also provides an option to specify the extension of the file name (or remove it entirely) when splitting is selected on tangling.
Details
The RweaveExtraLatex
and RtangleExtra
drivers extend the standard Sweave
drivers
RweaveLatex
and
Rtangle
, respectively. They are selected
through the driver
argument of Sweave
.
The drivers provide additional options to completely ignore code
chunks on weaving, tangling, or both. Chunks ignored on weaving are
not parsed and are written out verbatim on tangling. Chunks ignored on
tangling are processed as usual on weaving, but completely left out of
the tangled scripts. The driver RtangleExtra
also
provides the option extension
to specify the extension of the
file name (or remove it entirely) when splitting is selected.
In a literate programming workflow, the additional options allow to include code chunks in a file such as:
code that is not parsable by R (say, because of errors inserted for educational purposes);
code in another programming language entirely (say, a shell script to start an analysis);
code for a Shiny app.
With the standard drivers, using option eval = FALSE
results in
code being commented out in tangled scripts files. Chunks may be
omitted on tangling with drop.evalFALSE = TRUE
, but only
provided the chunk is not evaluated on weaving. Therefore, the
standard drivers have no provision to either omit a chunk on weaving
and tangle it as is, or to process a chunk on weaving but omit it
on tangling.
Author(s)
Vincent Goulet [cre, aut], R Core Team [aut] (Code from the original Sweave drivers)
Maintainer: Vincent Goulet <vincent.goulet@act.ulaval.ca>