Learn R Programming

loa (version 0.2.22)

4.7.other.panel.functions: Other panel functions argument handlers

Description

In development panel functions for use with lattice

Usage

parHandler(scheme = NULL, ...)


#related

getArgs(source = TRUE, local.resets = TRUE, 
         user.resets = TRUE, is.scales.lines = FALSE, 
         elements = NULL, ..., defaults = list(), 
         defaults.only = FALSE)

getPlotArgs(defaults.as = "axis.line", source = TRUE, 
         local.resets = TRUE, user.resets = TRUE, 
         elements = NULL, ..., is.scales.lines = NULL, 
         defaults.only = TRUE)

isGood4LOA(arg)

Arguments

scheme
The color scheme to apply. This can be a list of parameters to apply or a character vector for a pre-defined scheme. Current pre-defined schemes include 'greyscale' (for black and white figures).
source, local.resets, user.resets
When recovering plot arguments with getArgs or getPlotArgs, places to search for relevant parameters. If supplied these would typically be vectors or lists. If vectors, they are assumed to be col setti
is.scales.lines
When recovering arguments with getArgs or getPlotArgs, should source be treated as a lattice scales list? If so, and source is checked for line parameters, line-specific terms such
elements
When recovering arguments with getArgs or getPlotArgs, this identifies the elements in source, local.resets and user.resets that may contain case-specific information. As with
...
Other arguments, often ignored.
defaults, defaults.only, defaults.as
When recovering arguments with getArgs, defaults is an optional 'fall-back' in case nothing is recovered from source, local.resets and user.resets. defaults.only is a
arg
For isGood4LOA a plot argument that can used to turn a plot panel or panel component on or off.

Value

  • getArgs and getPlotArgs return lists of located parameters/values. For example, the call getPlotArgs(default.as = "axis.line") returns a list containing the lattice defaults for an axis line (alpha, col, lty and lwd) These can then be used in combination with appropriate x and y values in llines, or panel.lines calls. The arguments local.resets and user.resets can be added into the call to provide developer and user overrides. (See note below.) isGood4LOA returns a logical (TRUE or FALSE), depending on the type of a supplied argument. This returns FALSE for NULL, for all FALSE logicals, and any arg that has previously been tagged as 'not wanted'. parHandler returns a list a list suitable for use as par.settings with most lattice plots.

Details

getArgs returns a list of parameters/values based on lattice, developer and user settings. If multiple elements are identified as containing case-specific information, the list will contain one list of plot parameters for each named element. getPlotArgs is a variation of getArgs intended for use with panel... and l... type lattice functions. It returns a list of plot parameters for different plot components, e.g. symbols, lines, or text. isGood4LOA is a simple workhorse that checks if a supplied arg should be used by loa. (See value and note below.) parHandler manages the default appearance of plots.

References

These 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 other packages: See xyplot in lattice.

Examples

Run this code
#getPlotArgs/isGood4LOA notes

#in formals
#my.plot <- function(..., user.reset = TRUE, ...) 

#in main code body
#local.resets <- [what developer wants] 
#plot.arg <- getPlotArgs("[type]", source, local.reset, user.reset)

#in panel call
#(for panel off/on control)
#if(isGood4LOA(plot.arg)) panel...(..., plot.arg,...)

#in panel... function
#for panel component off/on control)
#if(isGood4LOA(plot.arg1)) panel...(..., plot.arg1,...)
#if(isGood4LOA(plot.arg2)) l...(..., plot.arg2,...)
#etc.

Run the code above in your browser using DataLab