Re: [Rd] sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...

2015-05-31 Thread Henrik Bengtsson
This is a great example how you cannot figure it out after spending two hours troubleshooting, but a few minutes after you post to R-devel, it's just jumps to you (is there a word for this other than impatient?); Let me answer my own question. The discrepancy between my sum2() code and the

[Rd] sum(..., na.rm=FALSE): Summing over NA_real_ values much more expensive than non-NAs for na.rm=FALSE? Hmm...

2015-05-31 Thread Henrik Bengtsson
I'm observing that base::sum(x, na.rm=FALSE) for typeof(x) == double is much more time consuming when there are missing values versus when there are not. I'm observing this on both Window and Linux, but it's quite surprising to me. Currently, my main suspect is settings in on how R was built.