>
> Here are a few alternatives:
>
> replace(a, is.na(a), 0) + b
>
> ifelse(is.na(a), 0, a) + b
>
> mapply(sum, a, b, MoreArgs = list(na.rm = TRUE))
>
Well, Gabor, if you want to get fancy...
evalq({a[is.na(a)]<-0;a})+b
(and variants...)
Cheers,
Bert