If the sum of a vector containing NAs is computed and na.rm is FALSE, the result is not always NA. R> w <- c(1:3,NA) R> sum(w) [1] NA BUT R> w <- c(NA, 1:3) R> sum(w) [1] 0 It seems that this problem only occurs, if the first element is NA. Andreas =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel 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-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-