Skip to content
Back to formatted view

Raw Message

Message-ID: <1422384222562-4702392.post@n4.nabble.com>
Date: 2015-01-27T18:43:42Z
From: JSHuang
Subject: Sum function and missing values --- need to mimic SAS sum function
In-Reply-To: <CA+8X3fUO_EBcXu0BG9PkX5KDU4MHXYkeGxTDfjcz=F9xEZuGuA@mail.gmail.com>

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.