[R] arith-true mean() fails make check on IRIX
Prof Brian Ripley
ripley at stats.ox.ac.uk
Wed Jan 3 08:45:02 CET 2007
On Tue, 2 Jan 2007, fissell+ at pitt.edu wrote:
> Hello,
>
> I am building R-2.4.1 on an SGI IRIX platform, using gcc 3.3.
> gmake check failed, and the arith-true.Rout.fail file indicated:
>> is.na(mean(c(1,NA,NA)[-1], trim = .1, na.rm = TRUE))
> [1] FALSE
>>
>
> I tried the mean() command in R and got:
>> mean(c(1,NA,NA)[-1], trim = .1, na.rm = TRUE)
> [1] Inf
>
> I think the problem is in the na.rm = TRUE, because I get:
>> mean(c(1,NA,NA)[-1])
> [1] NA
>
> How serious is this problem, and is there a workaround ?
It indicates that your compiler is getting the wrong answer when
computing 0./0, and that does look quite serious. You should get the
same answer as mean(numeric(0)), and that should be NaN.
As the compiler is very old, you might like to try updating it.
--
Brian D. Ripley, ripley at 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