[R] How to use panel.qqmathline?

Henric Nilsson henric.nilsson at statisticon.se
Sat Oct 4 16:49:18 CEST 2003


At 19:52 2003-10-04 +0800, you wrote:

>How can I use panel.qqmathline, in package lattice, to add
>straight lines onto the plots generated by qqmath?
>[...]
> > data(sleep)
> > qqnorm(~ extra | group, data=sleep, aspect=1)

Try

qqmath(~ extra | group,  data = sleep, aspect = 1,
             distribution = qnorm, prepanel = prepanel.qqmathline,
             panel = function(x, y, ...)  {
               panel.qqmathline(y, distribution = qnorm, ...)
               panel.qqmath(x, y, ...)
             })

Hope this helps,
Henric

---------------------------------------------------------------------------------------
Henric Nilsson, Statistician

Statisticon AB, Östra Ågatan 31, SE-753 22 UPPSALA
Phone (Direct): +46 (0)18 18 22 37
Mobile: +46 (0)70 211 68 36
Fax: +46 (0)18 18 22 33

<http://www.statisticon.se>




More information about the R-help mailing list