Re: R-beta: odd result with sum -- yes, fixed.

Martin Maechler (maechler@stat.math.ethz.ch)
Fri, 22 Aug 1997 14:57:43 +0200


Date: Fri, 22 Aug 1997 14:57:43 +0200
Message-Id: <199708221257.OAA26569@sophie.ethz.ch>
From: Martin Maechler <maechler@stat.math.ethz.ch>
To: lammers@edac.sr.unh.edu
Subject: Re: R-beta: odd result with sum -- yes, fixed.

>>>>> "RL" == Richard Lammers <lammers@edac.sr.unh.edu> writes:

    RL> I am using R 0.49 and I did not see this in the archives:

It was a bug; and it has been corrected a while.
Unfortunately, there hasn't been a new beta release of R in the mean time.

    RL> Given sum() defaults to na.rm = FALSE, should both of these results
    RL> be NA?

    > sum(c(1,NA))
    RL> [1] NA
    > sum(c(NA,1))
    RL> [1] 0

This is the current [0.50-a3 "alpha"]  (and desired) behavior :

> sum(c(1,NA)); sum(c(NA,1))
[1] NA
[1] NA
> sum(c(1,NA), na.rm=TRUE); sum(c(NA,1),na.rm=TRUE)
[1] 1
[1] 1
> 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=