DynamicDocContext-class: Settings/Options controlling the R evaluation of code in a...

DynamicDocContext-classR Documentation

Settings/Options controlling the R evaluation of code in a dynamic document

Description

This class is used to store the options that control the evaluation of R code when processing a dynamic document. These are separate and different from the parameters controlling the XSL transformation. These options control matters such as how output from commands is formatted, how graphics devices are created, where intermediate files are placed.

Objects from the Class

DynamicOptions is the primary function used to create instances of this class.

Slots

digits:

Object of class "integer", a value controlling the number of digits in the display of numbers in the textual output. This corresponds to the the digits option in R's options.

round:

Object of class "integer" a value controlling how numbers are rounded.

width:

Object of class "integer" controls the maximum number of columns on a line used in printing vectors, matrices and arrays, and when filling by 'cat'. This corresponds to the width option in R's options.

bg:

Object of class "character" color for the background of new graphics devices

fg:

Object of class "character" color for the foreground of new graphices devices

directory:

Object of class "Directory" the directory in which intermediate files such as plots are stored. This can be an "anonymous" temporary directory, or can be specified by the user so that she can access these files for subsequent use, i.e. not just for creating the PDF document.

plotDirectory:

Object of class "Directory" the name of the directory in which the generated plots are created. If this has a name, the name is used as a prefix to identify the file in the document. The file is created in the specified directory, but the name of the file used in the document is given by this prefix and the file name. So this allows us to use a different directory name or URL that is used when the document is published. This is of use for HTML documents in which the images, etc. are external files.

fontSize:

Object of class "integer" the size of the default font to use in a new graphics device

fontFamily:

Object of class "character" the name of the default font family to use in a new graphics device.

device:

Object of class "list" a named list giving the function use to create a graphics device. Typically this will have just one element, e.g. list(svg = svg) but one can specify several elements. Different plots within the dynamic document can specify a desired format and the corresponding element will be used. In other words, if we had a plot node such as <r:plot format="svg">plot(density(x))</r:plot> and another <r:plot format="png">plot(x, y)</r:plot> we would use the svg element and the png element, if they were present.

deviceDims:

Object of class "numeric" dimensions (horizontal and vertical) used when creating a graphics device when the dimensions are not specified on the XML node within the dynamic document.

targetFormat:

Object of class "DynamicTarget" an object representing the target format for the resulting document. We use this object to dispatch methods such as convert to transform R objects to the desired format.

env:

Object of class "environment" the top-level environment in which to evaluate the code within the dynamic document.

margins:

Object of class "numeric" currently not used. Intended to represent the margins of the target document being generated. This is more an XSL parameter however.

name
stopOnError

a logical value indicating whether an error should terminate the processing of the entire document.

other

Methods

This is used in dynDoc to represent the controls for the evaluation.

Author(s)

Duncan Temple Lang

See Also

dynDoc DynamicOptions is the primary constructor function for this class.

Examples

showClass("DynamicDocContext")



duncantl/XDynDocs documentation built on Jan. 4, 2024, 5:20 p.m.