Rev 5203 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{A_01_Lattice}\alias{Lattice}\alias{lattice}\alias{lattice-package}\title{Lattice Graphics}\description{Trellis Graphics for R}\details{Trellis Graphics is a framework for data visualization developed atthe Bell Labs by Rick Becker, Bill Cleveland, et al, extending ideaspresented in Bill Cleveland's 1993 book \emph{Visualizing Data}.Lattice is an implementation of Trellis Graphics for R.Type \code{help(package = lattice)} to see a list of (public)functions for which further documentation is available. The\sQuote{See Also} section below lists specific areas of interest withpointers to the help pages with respective details. Apart from thedocumentation accompanying this package, a book on lattice is alsoavailable as part of Springer's \sQuote{Use R} series.Lattice is built upon the Grid graphics engine and requires the\code{grid} add-on package. It is not (readily) compatible withtraditional R graphics tools. The public interface is based on theimplementation in S-PLUS, but features several extensions, in additionto incompatibilities introduced through the use of \code{grid}. Tothe extent possible, care has been taken to ensure that existingTrellis code written for S-PLUS works unchanged (or with minimalchange) in Lattice. If you are having problems porting S-PLUS code,read the entry for \code{panel} in the documentation for\code{\link{xyplot}}. Most high level Trellis functions in S-PLUS areimplemented, with the exception of \code{piechart}.The example section below shows how to bring up a brief history ofchanges to the lattice package, which provides a summary of newfeatures.}\note{High level Lattice functions (like \code{\link{xyplot}}) are differentfrom conventional R graphics functions because they don't actuallydraw anything. Instead, they return an object of class\code{"trellis"} which has to be then\code{\link[lattice:print.trellis]{print}}ed or\code{\link[lattice:print.trellis]{plot}}ted to create the actualplot. This is normally done automatically, but not when the highlevel functions are called inside another function (most often\code{source}) or other contexts where automatic printing issuppressed (e.g. \code{\link{for}} or \code{\link{while}} loops). Insuch situations, an explicit call to \code{print} or \code{plot} isrequired.Lattice plots are highly customizable via user-modifiable settings.However, these are completely unrelated to base graphics settings; inparticular, changing \code{par()} settings usually have no effect onlattice plots.}\references{Sarkar, Deepayan (2008) \dQuote{Lattice: Multivariate DataVisualization with R}, Springer. ISBN: 978-0-387-75968-5\url{http://lmdvr.r-forge.r-project.org/}Cleveland, W.S. (1993) \emph{Visualizing Data}.Becker, R.A., Cleveland, W.S. and Shyu, M.\dQuote{The Visual Design and Control of Trellis Display},\emph{Journal of Computational and Graphical Statistics}Bell Lab's Trellis Page contains several documents outlining the useof Trellis graphics; these provide a holistic introduction tothe Trellis paradigm:\url{http://cm.bell-labs.com/cm/ms/departments/sia/project/trellis/}}\seealso{The Lattice user interface primarily consists of several \sQuote{highlevel} generic functions (listed below), each designed to create aparticular type of statistical display by default. While eachfunction does different things, they share several common features,reflected in several common arguments that affect the resultingdisplays in similar ways. These arguments are extensively (sometimesonly) documented in the help page for \code{\link{xyplot}}. Thisincludes a discussion of \emph{conditioning} and control of theTrellis layout.Lattice employs an extensive system of user-controllable parameters todetermine the look and feel of the displays it produces. To learn howto use and customise the Graphical parameters used by the Latticefunctions, see \code{\link{trellis.par.set}}. For other settings, see\code{\link{lattice.options}}. The default graphical settings aredifferent for different graphical devices. To learn how to initialisenew devices with the desired settings or change the settings of thecurrent device, see \code{\link{trellis.device}}.To learn about sophisticated (non-default) printing capabilities, see\code{\link{print.trellis}}. See \code{\link{update.trellis}} tolearn about manipulating a \code{"trellis"} object. Tools to augmentlattice plots after they are drawn (including\code{\link{locator}}-like functionality) is described in the\code{\link{trellis.focus}} help page.The following is a list of \sQuote{high level} functions in theLattice package with a brief description of what they do. In allcases, the actual display is produced by the so-called \code{panel}function, which has a suitable default, but can be substituted by anuser defined function to create custom displays. The user will mostoften be interested in the default panel functions, which have aseparate help page, linked to from the help pages of the correspondinghigh level function. Although documented separately, arguments tothese panel functions can be supplied directly to the high levelfunctions, which will forward the arguments as appropriate.\bold{Univariate:}\code{\link{barchart}} bar plots\code{\link{bwplot}} box and whisker plots\code{\link{densityplot}} kernel density plots\code{\link{dotplot}} dot plots\code{\link{histogram}} histograms\code{\link{qqmath}} quantile plots against mathematical distributions\code{\link{stripplot}} 1-dimensional scatterplot\bold{Bivariate:}\code{\link{qq}} q-q plot for comparing two distributions\code{\link{xyplot}} scatter plot (and possibly a lot more)\bold{Trivariate:}\code{\link{levelplot}} level plots (similar to image plots in R)\code{\link{contourplot}} contour plots\code{\link{cloud}} 3-D scatter plots\code{\link{wireframe}} 3-D surfaces (similar to persp plots in R)\bold{Hypervariate:}\code{\link{splom}} scatterplot matrix\code{\link{parallel}} parallel coordinate plots\bold{Miscellaneous:}\code{\link{rfs}} residual and fitted value plot (also see\code{\link{oneway}})\code{\link{tmd}} Tukey Mean-Difference plotAdditionally, there are several panel functions that do little bythemselves, but can be useful components of custom panel functions.These are documented in \code{\link{panel.functions}}. Lattice alsohas a collection of convenience functions that correspond to the basegraphics primitives \code{\link{lines}}, \code{\link{points}},etc. They are implemented using Grid graphics, but try to be as closeto the base versions as possible in terms of their argumentlist. These functions have imaginative names like\code{\link{llines}} or \code{\link{panel.lines}} and are often usefulwhen writing (or porting from S-PLUS code) nontrivial panel functions.}\examples{\dontrun{RShowDoc("NEWS", package = "lattice")}}\author{Deepayan Sarkar \email{Deepayan.Sarkar@R-project.org}}\keyword{dplot}