From i@t@z@hn @ending from gm@il@com  Mon Jul  2 18:20:30 2018
From: i@t@z@hn @ending from gm@il@com (Ista Zahn)
Date: Mon, 2 Jul 2018 12:20:30 -0400
Subject: [Rd] base::mean not consistent about NA/NaN
In-Reply-To: <CAOO9MKXXtUm=XJc-Wb7k=1ah5yheP-KMfFS3rQKZc7o6GfQF=w@mail.gmail.com>
References: <CAOO9MKXXtUm=XJc-Wb7k=1ah5yheP-KMfFS3rQKZc7o6GfQF=w@mail.gmail.com>
Message-ID: <CA+vqiLHW_V27YLiz9xJw4qfr6o4kL6OCSo1zBaanRH1BX9oDug@mail.gmail.com>

The current behavior is as documented. See ?NA, which says

"Numerical computations using ?NA? will normally result in ?NA?: a
     possible exception is where ?NaN? is also involved, in which case
     either might result"

--Ista

On Mon, Jul 2, 2018 at 11:25 AM, Jan Gorecki <j.gorecki at wit.edu.pl> wrote:
> Hi,
> base::mean is not consistent in terms of handling NA/NaN.
> Mean should not depend on order of its arguments while currently it is.
>
>     mean(c(NA, NaN))
>     #[1] NA
>     mean(c(NaN, NA))
>     #[1] NaN
>
> I created issue so in case of no replies here status of it can be looked up
> at:
> https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17441
>
> Best,
> Jan
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] base::mean not consistent about NA/NaN
Ista Zahn