[R] Strange warning in summary.lm

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Wed Jul 25 12:37:30 CEST 2007


> -----Oorspronkelijk bericht-----
> Van: Prof Brian Ripley [mailto:ripley op stats.ox.ac.uk] 
> Verzonden: woensdag 25 juli 2007 12:20
> Aan: ONKELINX, Thierry
> CC: r-help op stat.math.ethz.ch
> Onderwerp: Re: [R] Strange warning in summary.lm
> 
> On Wed, 25 Jul 2007, ONKELINX, Thierry wrote:
> 
> > Dear Peter, Uwe and Brian,
> >
> > I've found some more problems with options(OutDec = ",").
> >
> > 1) as.numeric yields NA where it shouldn't
> 
> It should: where does it say otherwise?  OutDec affects output, only.

I was doing something like

> options(OutDec = ",")
> df <- data.frame(var = rep(1:8/4, 10), x = rnorm(80))
> df.a <- aggregate(df$x, by = list(var = df$var), FUN = sum)
> as.numeric(df.a$var)
[1] NA NA NA  1 NA NA NA  2
Warning message:
NAs introduced by coercion in: as.double.default(df.a$var) 

because I needed df.a$var as numeric again.

> > 2) anova yields the same warning as summary
> 
> It does not in current R: try any fairly recent version of R-devel.
> 
> Please don't keep reporting a problem we have already fixed, 
> as the FAQ and the posting guide explicitly ask of you.

Sorry about that. I wasn't aware that the error was in a fixed
subroutine that is used by summary and anova.
I'm hestating to use a R-devel version because I haven't tried
installing R from a tar.gz (I'm one of those lazy windows users that
prefer the .exe version). For now I think I'll return to the good old
option(OutDec = ".").
> 
> [...]
> 
> 
> -- 
> Brian D. Ripley,                  ripley op stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>



More information about the R-help mailing list