Really simple question, to which I haven't been able to Google/find an answer.
I have a simple file - "test.txt"
Gender arch1
M 99
F 97
M NA
I load this into a resultset using read.table - works fine.
attach(resultset)
Now, I want _something_ that will give me
mean(arch1, [_SOMETHING_]) = 65.3 (and *_NOT_* 98)
i.e. not na.rm = T or similar. Basically, I want to treat NA as 0 - and I don't want to do something complicated like here with matrices and dataframes.
Just NA = 0 from the file. Surely, I can't be the first person to have wanted this? And I don't want discussions about how NA and 0 are not the same thing. I think it's perfectly valid to want to calculate an average even over missing students!