I need to get the mean of all columns of a large data set using R, grouped by 2 variables.
Lets try it with mtcars:
library(dplyr) g_mtcars <- gro
For the sake of completeness you could use package plyr and do this:
plyr
library(plyr) ddply(mtcars,c('cyl','gear'), summarize,mean_hp=mean(hp))