How to sum columns whith NA within groups?
Posted: Mon Jul 16, 2018 10:34 pm
Hello, I have two groups
group1 resid1 resid2 resid3 resid4
group2 resid5 resid6 resid resid8
I want to sum resid1 and resid5, I mean the first row of resid1 and the first row of resid5 and so as it. But there are NAs sometimes in both series and when I sum by rows a number and a NA, the result is like this "number + NA= NA ". How i can obtain "number+NA=number".
group1 resid1 resid2 resid3 resid4
group2 resid5 resid6 resid resid8
I want to sum resid1 and resid5, I mean the first row of resid1 and the first row of resid5 and so as it. But there are NAs sometimes in both series and when I sum by rows a number and a NA, the result is like this "number + NA= NA ". How i can obtain "number+NA=number".