Learn R Programming

pkgmaker (version 0.10.1)

rnw: Utilities for Vignettes

Description

rnw provides a unified interface to run vignettes that detects the type of vignette (Sweave or knitr), and which Sweave driver to use (either automatically or from an embedded command \VignetteDriver command).

as.rnw creates a S3 rnw object that contains information about a vignette, e.g., source filename, driver, fixed included files, etc..

rnwCompiler tries to detect the vignette compiler to use on a vignette source file, e.g., Sweave or knitr.

rnwWrapper tries to detect the type of vignette and if it is meant to be wrapped into another main file.

rnwDriver tries to detect Sweave driver to use on a vignette source file, e.g., SweaveCache, highlight, etc..

rnwIncludes detects fixed includes, e.g., image or pdf files, that are required to build the final document.

rnwChildren detects included vignette documents and return them as a list of vignette objects.

vignetteMakefile returns the path to a generic makefile used to make vignettes.

Usage

rnw(x, file = NULL, ..., raw = FALSE)

as.rnw(x, ..., load = TRUE)

rnwCompiler(x, verbose = TRUE)

rnwWrapper(x, verbose = TRUE)

rnwDriver(x)

rnwIncludes(x)

rnwChildren(x)

vignetteMakefile(user = NULL, package = NULL, skip = NULL, print = TRUE, template = NULL, temp = FALSE)

Arguments

x
vignette source file specification as a path or a rnw object.
file
output file
...
extra arguments passed to as.rnw that can be used to force certain building parameters.
raw
a logical that indicates if the raw result for the compilation should be returned, instead of the result file path.
load
logical to indicate if all the object's properties should loaded, which is done by parsing the file and look up for specific tags.
verbose
logical that toggles verbosity
package
package name. If NULL, a DESRIPTION file is looked for one directory up: this meant to work when building a vignette directly from a package's 'vignettes' sub-directory.
user
username of the package's author. It is used to compile the vignette differently when called locally or on CRAN check machines.
skip
Vignette files to skip (basename).
print
logical that specifies if the path should be printed or only returned.
template
template Makefile to use. The default is to use the file vignette.mk shipped with the package pkgmaker and can be found in its install root directory.
temp
logical that indicates if the generated makefile should using a temporary filename (TRUE), or simply named vignette.mk