I want to sum two columns let's say the columns "apinten" and "apmod". I want R to ignore Na if there is Na in only one of the two columns, but I want to report "Na" if the two columns are Na ... For the moment I did it :
etude1<-within(etude1,{mvpascore<-rowSums(cbind(apinten,apmod), na.rm = T, dims = 1)})
and it
etude1<-within(etude1,{mvpascore<-apply(cbind(apinten,apmod), 1, sum, na.rm = TRUE)})
With these commands, if only one is missing R reports only the value of the other one in the new columns, but if both columns apinten and apmod are Na, R reports the value "0" in the news columns ... 0 is a value and I don't want it.