[R] Handling NA values

Christofer Bogaso bogaso.christofer at gmail.com
Sat Feb 16 18:55:33 CET 2013


Hello again,

I have a question on who sum() handle the NA values.

> sum(c(NA, 1), na.rm = TRUE)
[1] 1


I understand this. However could not agree with following:

> sum(c(NA, NA), na.rm = TRUE)
[1] 0


Where this '0' is coming from? Should not it be NA itself?

Thanks and regards,



More information about the R-help mailing list