[R] qqmath - Lattice error

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Thu May 25 23:38:13 CEST 2006



Witold Wolski wrote:
> Hi,
> 
> Don't have a clue what teh following error message
> 
> 
> generated by this function call:
> qqmath( ~val|ind,data = xx
>        ,distribution = function(p){ qt(p,df=20)}
>        ,ylab="Sample Quatinles"
>        ,xlab="Theoretical Quantiles"
> 
>        ,panel=function(x,y)
>        {
>          panel.qqmathline(y
>                           , distribution=function(p) qt(p,df=20)
>                           ,col=2)
>          panel.qqmath(x, y
>                       , distribution=function(p) qt(p,df=20)
>                       ,pch=".",cex=2)
>        }
> )
> 
> means. Espacially that this function call
> 
> qqmath( ~val|ind,data = xx
>        ,distribution = function(p){ qt(p,df=20)}
>        ,ylab="Sample Quatinles"
>        ,xlab="Theoretical Quantiles"
> )
> 
> with the same data is working.
> 
> Thanks in advance for suggestions.
> 
> Eryk
> 

Hi, Eryk,

The function panel.qqmath does not take an argument "y".

Here's a complete example (which you should have supplied):

library(lattice)
set.seed(1)
xx <- data.frame(ind = factor(rep(1:4, each = 100)))
xx$val <- rt(400, 20)
qt2 <- function(p) qt(p, df = 20)
qqmath(~val | ind, data = xx,
        distribution = qt2,
        ylab = "Sample Quantiles",
        xlab = "Theoretical Quantiles",
        panel = function(x) {
          panel.qqmathline(x, distribution = qt2, col = 2)
          panel.qqmath(x, distribution = qt2, pch=".", cex = 2)
        })

--sundar

P.S. Please (re-)read the posting guide. If you get an error in your 
script, tell us what it is. And provide an complete example (the posting 
guide gives guidelines here). Quite often I solve my own problem in the 
process of coming up with an example I'd like to post to R-help.



More information about the R-help mailing list