I have several data frames, a b c d, each with the same column names. I want to find the mean and median of those data frames. In other words, construct new mean and median data frames that are the same size as a, b, etc.
I could use a couple of for loops, but I bet there is a slick way of doing this using the R built-in functions that would be faster.
Following Josh Ulrich’s answer, how about
?
(Using
rowMeanson the appropriate slice will still be faster thanapplyingmean… I think there is arowMediansin theBiobase(Bioconductor) package if you really need speed?)