Wednesday 21 August 2013

Element wise mean for a list of dataframes with NA

Element wise mean for a list of dataframes with NA

I have a list of data frames x and I want to find the mean of each element
across the data frames. I found an elegant solution online courtesy of
Dimitris Rizopoulos.
x.mean = Reduce("+", x) / length(x)
However this doesn't really work when the data frames contain NA. Is there
a good way to accomplish this?

No comments:

Post a Comment