Q:

Convert list of tables to matrix

I have a list containing 270 tables. Each table has 3 columns and 22 rows, looking something like this:
                1         2         3
lx      -0.206628 -0.148405 -0.159344    
ly       0.017395  0.043114  0.027263    
lz      -0.044009  0.005597 -0.016906
...

I need each of these tables merged into a giant 270x66 matrix, where the rows are each table and the columns are values in the table columns. I've tried using lapply, as.matrix, and data.matrix. Is there some kind of combination of these that will do the trick? Or should I first convert the table into vectors, then into the matrix? I know loops are generally discouraged.

A:

You could create a vector using unlist and then create a new matrix:
matrix(unlist(mylist), nrow = length(mylist), byrow = TRUE)

An example:
mylist <- rep(list(matrix(1:9, 3)), 3)
matrix(unlist(mylist), nrow = length(mylist), byrow = TRUE)
# 
#       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
# [1,]    1    2    3    4    5    6    7    8    9
# [2,]    1    2    3    4    5    6    7    8    9
# [3,]    1    2    3    4    5    6    7    8    9

