Skip to content
Back to formatted view

Raw Message

Message-ID: <E438093B-B205-4DC8-9AC1-684413A14DA1@comcast.net>
Date: 2011-10-12T17:33:48Z
From: David Winsemius
Subject: treat NA's as zero when summed up with numbers
In-Reply-To: <000001cc88fe$65a2f1b0$30e8d510$@ch>

On Oct 12, 2011, at 12:45 PM, Samir Benzerfa wrote:

> Hello everybody,
>
>
>
> is there any way to treat NA's as zero when they are summed up with  
> numbers,
> but to treat them as NA's when summed up only with NA's.  
> Specifically want
> that: 5+NA=5, but NA+NA=NA (and not zero).
>

sum(x , na.rm=TRUE)

-- 
David Winsemius, MD
West Hartford, CT