gplotArgs.data.frame {latticeExtra}R Documentation

Grouped Display Arguments from a Data Frame

Description

Extract arguments suitable for gplot from a data.frame with appropriate meta-data

Usage

## S3 method for class 'data.frame':
gplotArgs(x, display.formula,
          outer = FALSE, inner = FALSE, ...)
## S3 method for class 'data.frame':
gplotArgs(x) <- value

Arguments

x an object of class ``data.frame''
display.formula a Trellis display formula
outer logical or one-sided formula
inner logical or one-sided formula
... extra arguments, passed on as appropriate
value a list containing named components, to be stored as special attributes of x, including but not limited to
formula:
a model formula with a response, covariate and grouping variable, i.e. of the form y ~ x | g, where x could be 1

order.groups:
logical, defaults to TRUE, whether levels of g will be reordered for the plot
FUN:
a function of x used to reorder levels of g, applied to subsets of x determined by g
outer:
one-sided formula, defaults to NULL
inner:
one-sided formula, defaults to NULL
labels:
list of character strings (or expressions?) with named comonents, specifying variable names used in plot labels. The component names must be variables in the data frame. Not all variables need be present (if not, the variable names will be used for labels).
units:
list, similar to labels, but specifying the units of measurement (if present, used in constructing labels)

These are modeled on the groupedData function in package nlme, and are stored as meta-data in the data frame x. The components listed above are special in the sense that they are used by the corresponding gplotArgs method to contruct a suitable list as descibed in gplotArgs.default. Any other components in value can be used to override the values thus constructed, including display.formula.

Details

The gplotArgs method for data frames constructs a suitable list as descibed in gplotArgs.default. The display.formula argument can be used to specify the Trellis formula used (usually, it will be constructed from the meta-data).

For the role of outer and more details, consult nlme documentation for now.

Value

gplotArgs should return a list.

Author(s)

Deepayan Sarkar deepayan@stat.wisc.edu

See Also

gplot

Examples

gplotArgs(iris) <-
    list(formula = Sepal.Length ~ 1 | Species,
         order.groups = TRUE,
         labels = list(Sepal.Length = "Sepal\nLength",
         Sepal.Width = "Sepal\nWidth"))
gplot(iris)
gplot(iris, display.formula = Sepal.Length ~ Sepal.Width | Species)

[Package latticeExtra version 0.4-1 Index]