First, I would make it stackable by turning the name into a column:
for (i in seq_along(thelist)) thelist[[i]]$dfname <- names(thelist)[i]
Then, add and take using data.table :
require(data.table) DT <- rbindlist(thelist) DT[,lapply(.SD,mean),by=dfname]
which gives
dfname x1 x2 1: a 0.074625644 0.2086220 2: b -0.424558873 0.3220446 3: c -0.008715537 0.2216860
You can also consider the summary function, although it is awkward here:
DT[,as.list(unlist(lapply(.SD,summary))),by=dfname] # dfname x1.Min. x1.1st Qu. x1.Median x1.Mean x1.3rd Qu. x1.Max. x2.Min. x2.1st Qu. x2.Median x2.Mean x2.3rd Qu. x2.Max. # 1: a -1.265 -0.5318 -0.07983 0.074630 0.37800 1.715 -1.9670 -0.32690 0.3803 0.2086 0.6505 1.7870 # 2: b -1.687 -1.0570 -0.67700 -0.424600 0.06054 1.254 -0.3805 -0.23680 0.4902 0.3220 0.7883 0.8951 # 3: c -1.265 -0.6377 -0.30540 -0.008716 0.56410 2.169 -1.5490 -0.03929 0.1699 0.2217 0.5018 1.5160
Finally, by copying my old answer , you can create your own summary statistics function:
summaryfun <- function(x) list(mean=mean(x),sd=sd(x)) DT[,as.list(unlist(lapply(.SD,summaryfun))),by=dfname]
Frank source share