Re: [R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-04 Thread Ted Harding
I've been following this thread, and wondering where it might lead. My (possibly naive) view of these matters is basically logical, relying on (possibly over-simplified) interpretaions of "NA" and "NaN". These are that: "NaN" means "Not a Number", though it can result from a numerical

Re: [R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-04 Thread Barry Rowlingson
I'm having deja-vu of a similar discussion on R-devel: https://stat.ethz.ch/pipermail/r-devel/2018-July/076377.html This was the funniest inconsistency I could find: > sum(c(NaN,NA)) [1] NaN > sum(NaN,NA) [1] NA THEY'RE IN THE SAME ORDER!!! The doc in ?NaN has this clause: In R,

Re: [R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-03 Thread Rolf Turner
On 04/07/18 00:24, Martin Møller Skarbiniks Pedersen wrote: Hi, I am currently using R v3.4.4 and I just discovered this: prod(NA, NaN) ; prod(NaN, NA) [1] NA [1] NaN ?prod says: If ‘na.rm’ is ‘FALSE’ an ‘NA’ value in any of the arguments will cause a value of ‘NA’ to be

[R] prod(NaN, NA) vs. prod(NA, NaN)

2018-07-03 Thread Martin Møller Skarbiniks Pedersen
Hi, I am currently using R v3.4.4 and I just discovered this: > prod(NA, NaN) ; prod(NaN, NA) [1] NA [1] NaN ?prod says: If ‘na.rm’ is ‘FALSE’ an ‘NA’ value in any of the arguments will cause a value of ‘NA’ to be returned, otherwise ‘NA’ values are ignored. So according to the