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

See Also

gplot

Alias

gplotArgs.data.frame, gplotArgs<-.data.frame

Keyword

dplot

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)

Results


R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(latticeExtra)
> png(filename="images/gplotArgs.data.frame_%03d.png" ,width=480, height=480)
> ### Name: gplotArgs.data.frame
> ### Title: Grouped Display Arguments from a Data Frame
> ### Aliases: gplotArgs.data.frame gplotArgs<-.data.frame
> ### Keywords: dplot
> 
> ### ** 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)
> 
> 
> 
> dev.off()
null device 
          1 
> 



[Package latticeExtra Index]