Skip to content
Prev 166082 / 398502 Next

Selecting variables from a list of data.frames

Magnus <account <at> zulutime.net> writes:
x <- sapply(df.list,"[[","variable")  

will extract the variables as a matrix.
If the variables are all vectors of the same
length then you might follow this with
rowSums(x)/ncol(x) or apply(x,1,mean)