RtangleExtra {RweaveExtra}R Documentation

R Driver for Stangle with Additional Options

Description

A driver for Sweave extending the standard driver Rtangle with additional code chunk options.

Usage

RtangleExtra()

RtangleExtraSetup(file, syntax, output = NULL, annotate = TRUE,
                  split = FALSE, quiet = FALSE, drop.evalFALSE = FALSE,
                  ignore.on.tangle = FALSE, ignore = FALSE,
                  extension = NULL, ...)

Arguments

file

Name of Sweave source file. See the description of the corresponding argument of Sweave.

syntax

An object of class SweaveSyntax. See Rtangle.

output

Name of output file used unless split = TRUE. See Rtangle.

annotate

A logical or function. See Rtangle.

split

Split output into a file for each code chunk?

quiet

Logical to suppress all progress messages.

drop.evalFALSE

See Rtangle.

ignore.on.tangle

If TRUE, the code chunk is ignored entirely.

ignore

An alternative way to set both ignore.on.weave of RweaveExtraLatex and ignore.on.tangle.

extension

Extension to use for the file name, without the leading dot, when splitting is selected. If NULL, the default extension of Rtangle is used (the ‘engine’, usually ‘R’). If FALSE, no extension is added to the file name.

...

See RweaveLatex.

Details

Chunks ignored on tangling are not written out to script files, but they are processed normally on weaving (unless ignore = TRUE). Therefore, chunks may still use eval = TRUE for weaving purposes, yet not be tangled.

The argument extension is specially useful with ignore.on.weave = TRUE of RweaveExtraLatex to include code or text that the engine would not be able to parse.

Value

Named list of five functions; see Sweave or the ‘Sweave User Manual’ vignette in the utils package.

Author(s)

Vincent Goulet, based on work by Friedrich Leisch and R-core.

See Also

RweaveExtraLatex, Rtangle, Sweave.

Examples

testfile <- system.file("examples", "example-extra.Rnw",
                        package = "RweaveExtra")


## Check the contents of the file
if (interactive()) file.show(testfile)

## Tangle the file in the current working directory
Stangle(testfile, driver = RtangleExtra())

## View tangled file
if (interactive()) file.show("example-extra.R")

## Use 'extension=sh' with 'ignore.on.weave=TRUE', and
## the options 'split=TRUE' and 'prefix=FALSE' of Stangle
## to extract the shell script to a file 'hello.sh'
Stangle(testfile, driver = RtangleExtra(),
        split = TRUE, annotate = FALSE)
if(interactive()) file.show("hello.sh")



[Package RweaveExtra version 1.1-0 Index]