Skip to content
Prev 301016 / 398503 Next

help with element-by-element sum with NA

Perhaps something like:

Reduce(function(x,y){x[is.na(x)] <- 0; y[is.na(y)] <- 0; x + y}, list(A,B,C))

Not the most elegant, but it will get the job done.

Michael
On Mon, Jul 23, 2012 at 3:47 PM, Thiago Couto <couto.thiagoba at gmail.com> wrote: