Title: | Tools and extensions for processing Sweave documents |
---|---|
Description: | This package provides enhancements on the Sweave() function in the base package. In particular a facility for caching code chunk results is included. |
Authors: | Seth Falcon |
Maintainer: | Seth Falcon <[email protected]> |
License: | GPL-2 |
Version: | 1.73.0 |
Built: | 2024-10-31 06:27:59 UTC |
Source: | https://github.com/bioc/weaver |
These functions are not part of the public API of the package.
A modified driver for Sweave
that translates R code
chunks in LaTeX files. Presently, the primary modification is that
this version provides chunk caching. In the chunk options, you can
specify cache=TRUE
and the results of that chunk will be
cached.
weaver() weaverLatexSetup(file, syntax, output = NULL, quiet = FALSE, debug = FALSE, echo = TRUE, eval = TRUE, keep.source = FALSE, split = FALSE, stylepath = TRUE, pdf = TRUE, eps = TRUE, use.cache = TRUE)
weaver() weaverLatexSetup(file, syntax, output = NULL, quiet = FALSE, debug = FALSE, echo = TRUE, eval = TRUE, keep.source = FALSE, split = FALSE, stylepath = TRUE, pdf = TRUE, eps = TRUE, use.cache = TRUE)
file |
Name of Sweave source file. |
syntax |
An object of class |
output |
Name of output file, default is to remove extension
‘.nw’, ‘.Rnw’ or ‘.Snw’ and to add extension
‘.tex’. Any
directory names in |
quiet |
If |
debug |
If |
stylepath |
If |
echo |
set default for option |
eval |
set default for option |
keep.source |
set default for option 'keep.source', see details below. |
split |
set default for option |
pdf |
set default for option |
eps |
set default for option |
use.cache |
a logical indicating whether or not to use the
caching system. If |
weaver
supports the following options for code chunks (the values
in parentheses show the default values):
logical (TRUE
). Include S code in the
output file?
logical (TRUE
). If FALSE
, the code chunk is not
evaluated, and hence no text or graphical output produced.
logical (FALSE
). When echoing, if keep.source ==
TRUE
the original source is copied to the file. Otherwise,
deparsed source is echoed.
character string (verbatim
).
If verbatim
, the output of S commands is
included in the verbatim-like Soutput environment. If
tex
, the output is taken to be already proper latex markup
and included as is. If hide
then all output is
completely suppressed (but the code executed during the weave).
logical (FALSE
)
If TRUE
, each expression in the
code chunk is wrapped into a print()
statement before evaluation,
such that the values of all expressions become visible.
logical (TRUE
). If TRUE
, visibility of values
emulates an interactive R session: values of assignments are not
printed, values of single objects are printed. If FALSE
,
output comes only from explicit print
or
cat
statements.
logical (FALSE
). If TRUE
, text output is
written to separate files
for each code chunk.
character string (false
). If true
, blank
lines at the beginning and end of output are removed. If
all
, then all blank lines are removed from the output.
logical (TRUE
). If TRUE
generated filenames of
figures and output have a common prefix.
a character string, default is the name of the ‘.Snw’ source file.
logical (TRUE
), indicating whether input
statements for text output and includegraphics statements
for figures should be auto-generated. Use include = FALSE
if
the output should appear in a different place than the code chunk
(by placing the input line manually).
logical (FALSE
), indicating whether the code
chunk produces
graphical output. Note that only one figure per code chunk can be
processed this way.
logical (TRUE
), indicating whether EPS figures shall be
generated. Ignored if fig = FALSE
.
logical (TRUE
), indicating whether PDF figures shall be
generated. Ignored if fig = FALSE
.
numeric (6), width of figures in inch.
numeric (6), height of figures in inch.
If TRUE
and weave
was called with
use.cache=TRUE
, then the caclulations in the code chunk
will be cached. Subsequent invocations will restore from the
cache if the code chunk has not changed. Side effects are not
captured. Do not use for chunks defining S4 classes or methods.
Seth Falcon (borrowing heavily from code by Friedrich Leisch)
Friedrich Leisch: Sweave User Manual, 2002
http://www.ci.tuwien.ac.at/~leisch/Sweave
## Not run: Sweave("yourfile.Rnw", driver=weaver()) ## End(Not run)
## Not run: Sweave("yourfile.Rnw", driver=weaver()) ## End(Not run)