[R] average among one factor in a nested dataframe
Junqian Gordon Xu
xjqian at gmail.com
Mon Apr 25 06:42:24 CEST 2011
I have two nested data frames:
I want to preserve id and f1, but want to collapse f2 and take the
corresponding mean values of a and b. Missing value in either dataframe
should be handled properly (i.e., just take the non-missing number
without dividing by 2).
I had a look at rowSum/Means and s/l/tapply, but couldn't figure out how
to handle this case cleanly. Any suggestions?
More information about the R-help