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 270×66 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.
You could create a vector using
unlistand then create a new matrix:An example: