Learn R Programming

odfWeave (version 0.4.1)

odfWeave: Sweave processing of Open Document Format (ODF) files

Description

Sweave processing of Open Document Format files

Usage

odfWeave(file, dest, workDir = tempdir(), control = odfWeaveControl())

Arguments

file
the ODF file created using OpenOffice V2.0 or above.
dest
path to put the processed file (should include file name and extension)
workDir
a path to a directory where the source file will be unpacked and processed
control
a list of control settings. See odfWeaveControl for the names of the settable control values and their effects.

Details

odfWeave can be used to embed R code within a word processing document. The odfWeave package was created so that the functionality of Sweave can used to generate documents that the end--user can easily edit.

The markup language used is the Open Document Format (ODF), which is an open, non--proprietary format that encompasses text documents, presentations and spreadsheets. There are several editors/office suites that can produce ODF files. OpenOffice, as of version 2.0, uses ODF as the default format. odfWeave has been tested with OpenOffice to produce text documents. As of the current version, odfWeave processing of presentations and spreadsheets should be considered to be experimental (but should be supported in subsequent versions).

The functionality of Sweave is mostly preserved in odfWeave, such as weaving, hooks, figure environments, etc. Some functionality, such as writing output to separate files for each code chunk using the split argument, doesn't make sense when using ODF. See RweaveOdf for more details about the available options.

odfWeave uses the noweb convention for R code. In-line R commands should be in calls and block code chunks should use the <<>>= syntax (i.e. no Latex syntax will currently work).

The image format and sizes are specified within the odfWeaveControl object. The dimensions of the image file and the dimensions of the rendered image can be set independently. See odfWeaveControl for more details. an ODF file with the R output [object Object]

odfWeaveControl, RweaveOdf, Sweave demoFile <- system.file("examples", "examples.odt", package = "odfWeave") outputFile <- gsub("examples.odt", "output.odt", demoFile) workingPath <- tempdir()

library(odfWeave) odfWeave(demoFile, outputFile, workingPath)

## see also system.file("examples", "simple.odt", package = "odfWeave") utilities