[R] error message in plot(aov-object) -- repost

Uwe Ligges ligges at statistik.uni-dortmund.de
Fri Jan 16 13:11:05 CET 2004

Pascal A. Niklaus wrote:

> Hi all,
> I posted this question several days ago, but did not get any answer 
> until now. Since I still have no clue about the source of this error 
> message, I repost a description of the problem including some code:
> A student at our institute fitted an aov model, and got the following 
> error message:
>     > plot(p.aov)
>     Hit <Return> to see next plot:
>     Hit <Return> to see next plot:
>     Error in plot.window(xlim, ylim, log, asp, ...) :
>            need finite ylim values
> The second plot was not produced. I then tried to produced the plot
> manually, which worked, and checked the range of the residuals:
>     > qqnorm(resid(p.aov))
>     > range(resid(p.aov))
>     [1] -0.2428688  0.2020649
> Her data set and the model are as follows:
> Data:
>  http://www.bot.unibas.ch/~pascal/ParzJan.csv
> Model (I don't understand the model, but that's not the issue here)
>  p <- read.csv("ParzJan.csv",header=T)
>  p.aov <-aov(terms(JI~SP+Ex+Neig+pH+K/G+H+D+tN+br+aN:br+tN:D
>    +br:D+aN:br:D+br:tN+aN:br:D + aN:br:tN+ K:D+ K:tN+ K:br
>    +K:aN:br+ G:K:D+ G:K:tN+ G:K:br+G:K:aN:br+ D:H+ tN:H+ br:H
>    + aN:br:H, keep.order=T), data=p)
> Any help regarding the source of this plot() error message is appreciated.

Without the data nobody was able to reproduce your problem ..

plot.lm() produces the error message, in particular the lines

    hii <- lm.influence(x, do.coef = FALSE)$hat

which appears to be 1 in some cases, and

    rs <- r.w/(s * sqrt(1 - hii))

(you get a division by zero and the outcome is Inf, hence it's not 
possible to scale the plot any more).

I'd call it a bug, but I don't know what the bug really is. I'll think 
about it...

Uwe Ligges

> Pascal
> P.S.: She used R 1.7.1 on a Mac, but the problem was reproducible on R 
> 1.8.1 under Linux.
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html

More information about the R-help mailing list