Learn R Programming

loa (version 0.3.1.1)

4.2.plot.structure.handlers: Handler functions for plot structure arguments.

Description

Function(s) for handling (front end) plot arguments like x and strip that manage the plot structure.

Usage

formulaHandler(x, data = NULL, groups = NULL, ..., 
        expand.plot.args = TRUE, formula.type = "z~x*y|cond", panel.zcases = FALSE, 
        coord.conversion = NULL, lattice.like = NULL, check.xy.dimensions = TRUE, 
        check.coord.dimensions = TRUE, get.zcase.dimensions = TRUE, 
        output = "extra.args")

matrixHandler(x, data = NULL, row.values=NULL, column.values=NULL, ...)

stripHandler(..., striplab=NULL)

getZcaseDimensions(...)

Value

formulaHandler returns a list, containing the plot elements defined in the supplied formula.

matrixHandler returns a list containing all supplied arguments, subject to the following modifications: matrix x converted to formula (z~x*y); data, replaced with supplied matrix content;

xlim and ylim, added is not suppied.

stripHandler returns a list containing all supplied arguments, subject to the following modifications: strip, Updated or generated if not supplied; striplab, added to strip via the strip

argument var.name, if this is undeclared in call.

getZcaseDimensions returns a list containing all the supplied arguments, plus two additions arguments (if supplied in the call):

zcase.zlim and z.rowsum.lim. zcase.zlim is a list of lim values, one for each zcase.

z.rowsum.lim is the range of 'by-row' sums of zcases. These are calculated using any zcase information supplied in the call.

Arguments

x

(For formulaHandler) A formula or matrix (matrixHandler) intended to be used to generate a lattice plot. See Below.

data

If supplied, the assumed source of the elements of formula x, typically a data.frame.

groups

If supplied, the grouping argument to be used with x and data.

...

Additional arguments are passed on to related functions.

expand.plot.args

For formulaHandler only, logical. Should any short elements of the plot structure be expanded?

formula.type

For formulaHandler only, character vector or function. The plot structure to be used when generating the plot, e.g. z ~ x * y | cond for loaPlot

panel.zcases

For formulaHandler only, logical. Should zcase arguments, e.g. z1 and z2 in z1 + z2 ~ x * y | cond, be treated as panel conditioning terms rather than grouping terms?

coord.conversion

For formulaHandler only, function. If supplied, the conversion to use to convert coordinate information supplied using other coordinate systems to (x, y).

lattice.like

For formulaHandler only, list. For preprocessing, a list of plot terms that can be passed directly to lattice/loa plots.

check.xy.dimensions, check.coord.dimensions

For formulaHandler only, logicals. Should the formula structure be tested before attempting to generate the plot? See Note below.

get.zcase.dimensions

For formulaHandler only, logical. Should the dimensions of any multiple zcases b calculated? See Note below.

output

For formulaHandler only, character vector. The format to return function output in.

row.values, column.values

For matrixHandler only, row and column values to be assigned to supplied matrix x.

striplab

For stripHandler only, character vector. If supplied, the label to add to the panel strip when conditioning is applied. By default, it applies the standard lattice convention, i.e., show for numerics.

Author

Karl Ropkins

Details

formulaHandler manages the formula component or x element of of loa plot functions.

For example, for loaPlot it assumes the general formula structure z ~ x * y | cond, and applies it in a similar fashion to the lattice function levelplot.

Within the formula part of the plot call x and y are the horizontal and vertical axes, z is any additional information to be used in point, symbol, surface or glyph generation, and cond any additional conditioning to be applied. (The coordinates, x and y, are required elements; z and cond are typically optional.)

matrixHandler converts a matrix supplied as x element of a loa plot to a formula and associated data. If row.values and column.values are supplied, these are used as (x,y) values for the supplied matrix.

stripHandler manages the strip component of loa plot functions.

getZcaseDimensions tracks the dimensions of multiple z

References

This function makes extensive use of code developed by others.

lattice: Sarkar, Deepayan (2008) Lattice: Multivariate Data Visualization with R. Springer, New York. ISBN 978-0-387-75968-5

See Also

In loa: loaPlot; panelPal

In other packages: levelplot in lattice.