[R] Lattice: Add abline to Single Value qqmath() Plot

David L Carlson dcarlson at tamu.edu
Tue May 15 20:18:29 CEST 2012


Take a look at section 3.3.6 qqmath
http://www.his.sunderland.ac.uk/~cs0her/Statistics/UsingLatticeGraphicsInR.h
tm

You need to create a panel function. See sections 2.5.2 and 2.5.3 in the
second chapter of the Lattice book
(http://dsarkar.fhcrc.org/lattice/book/chapter2.pdf) available on Deepayan
Sarkar's webpage.

This is a simple example modified from the example in the lattice package
manual:

qqmath(~ rnorm(100), 
  panel = function(x, ...) {
    panel.qqmathline(x, ...)
    panel.qqmath(x, ...)
  })


----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Rich Shepard
> Sent: Tuesday, May 15, 2012 12:31 PM
> To: r-help at r-project.org
> Subject: [R] Lattice: Add abline to Single Value qqmath() Plot
> 
>    The data are not normally distributed when untransformed and I'm
> trying
> various transformations to see if any would be appropriate to use. The
> lattice book (fig. 3.10) shows a 2-sample Q-Q plot with an abline but
> the
> code for the figure does not include the line.
> 
>    I'd appreciate a pointer to a reference on how to add an abline to a
> one-sample qqmath() plot in lattice.
> 
> Rich
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list