[R] Sum function and missing values --- need to mimic SAS sum function

JSHuang js.huang at protective.com
Tue Jan 27 19:43:42 CET 2015


Hi,

  Not sure if the following is what you look for:
>x <- c(1:10, NA, 12:20)
>sum(x[!is.na(x)])




--
View this message in context: http://r.789695.n4.nabble.com/Sum-function-and-missing-values-need-to-mimic-SAS-sum-function-tp4702344p4702392.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list