Learn R Programming

lattice (version 0.3-0)

Lattice: Lattice Graphics

Description

Implementation of Trellis Graphics

Arguments

Details

Lattice is an implementation of Trellis Graphics (see the references for details). It is intended to emulate the implementation of Trellis in S, and perhaps to add some functionality of its own. Existing Trellis code written for S-Plus should ideally work unchanged in Lattice, one unavoidable exception being custom panel functions (see the entry for panel in help(trellis.args), and also llines for a collection of functions meant to ease the conversion).

As of now, this implementation is very much incomplete; however, what has been implemented should be useful. (Note that there are no plans to implement the 3D display functions in the immediate future).

This implementation depends heavily on a new Graphics engine (Grid) for R being developed by Paul Murrell. Knowledge of Grid is not necessary for using Lattice, except when trying to use both Lattice and traditional R graphics concurrently. Grid graphics calls do not usually mix with usual R graphics, and need to be enclosed within calls to grid.start() and grid.stop(). To make the switch transparent to the end-user, print.trellis, which ultimately draws all the Lattice plots, now tries to preserve the state of the graphics device it prints to. library(lattice) automatically loads Grid, leaving the device in grid mode. The user can revert to non-grid mode by calling grid.stop(). Subsequently, Lattice calls can be used concurrently with usual R graphics calls (but not Grid graphics calls). New devices opened by trellis.device (in particular when a Lattice print is attempted with no devices active) open the device in non grid mode.

Type library(help = lattice) to see a list of (public) Lattice graphics functions.

References

Bell Lab's Trellis Page: http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/ Cleveland, W.S. (1993) Visualizing Data. Becker, R.A., Cleveland, W.S. and Shyu, M. ``The Visual Design and Control of Trellis Display'', Journal of Computational and Graphical Statistics

See Also

To get a general idea of what arguments are generally accepted by Lattice functions, see trellis.args.

To learn how to customise the Graphical parameters used by the Lattice functions, see trellis.settings.

To learn how to initialise new devices or change the settings of the current device, see trellis.device

To learn about sophisticated (non-default) printing capabilities, see print.trellis.

Here is a list of `high level' functions in the Lattice library with a brief description of what they do:

Univariate:

barchart bar plots bwplot box and whisker plots

densityplot kernel density plots

dotplot dot plots

histogram histograms

qqmath quantile plots against mathematical distributions

stripplot 1-dimensional scatterplot

Bivariate:

qq q-q plot for comparing two distributions xyplot scatter plot (and possibly a lot more)

Trivariate:

levelplot level plots (image plots in R) Hypervariate: splom scatterplot matrix parallel parallel coordinate plots Miscellaneous:

rfs residual and fitted value plot (also see oneway)

See llines if you need to write/port nontrivial panel functions.