Skip to content
Prev 295530 / 398502 Next

applying cbind (or any function) across all components in a list

I'm confused why I haven't made clear what I am asking for help with.  

I have two different lists with two (or many) components, [[1]] and [[2]]. 
One of the list has components with dim=c(2,3) and the other has dim=c(2,2). 
I want to create a new list with components dim=c(2,4) by binding together
the averages of the columns using
which should put out:

     [,1] [,2] [,3] [,4]
[1,]    1    2    3    4
[2,]    2    3    4    5

my problem is finding out how I can apply this function to all the
components within the list in the same function.

--
View this message in context: http://r.789695.n4.nabble.com/applying-cbind-or-any-function-across-all-components-in-a-list-tp4631128p4631228.html
Sent from the R help mailing list archive at Nabble.com.