Re: [Rd] NaN behavior of cumsum

2017-01-24 Thread Tomas Kalibera
Hi Lukas, thanks for the report. I've changed cumsum so that it is now consistent with cumprod wrt to NA/NaN propagation. Now NaN is not turned into NA unnecessarily. Still please be aware that generally NaNs may become NAs in R (on some platforms/compilers) ?NaN says "Computations

[Rd] NaN behavior of cumsum

2017-01-20 Thread Lukas Stadler
Hi! I noticed that cumsum behaves different than the other cumulative functions wrt. NaN values: > values <- c(1,2,NaN,1) > for ( f in c(cumsum, cumprod, cummin, cummax)) print(f(values)) [1] 1 3 NA NA [1] 1 2 NaN NaN [1] 1 1 NaN NaN [1] 1 2 NaN NaN The reason is that cumsum (in