I have a huge list with data.frames (same number of columns, different number of rows). I succeeded to use apply - instead of the for loops I learned to avoid - to create a mean value over specific columns in each list element with
t2<-lapply(t1, function(x) cbind(x,rowMeans(x[,c("ColumnX","ColumnY","ColumnZ")])))
The problem I am stuck with now is the new columns name. It is "rowMeans(x[,c("ColumnX","ColumnY","ColumnZ")])".
How can I change this for all list elements? My poor "lapply"-knowledge was not sufficient for this task.