I was searching for some approaches to unlist matrices and I think the most efficient and simplest one is
do.call(rbind, matrix_to_unlist)
. I tried it and it works but I have no idea why. rbind()
function is designed to add a row to matrix/data frame so how is this possible to work ? Could you please explain to me what exactly do.call()
is doing with rbind()
function that in output we get matrix unlisted ?
If you check the help file of do.call, it reads
So, let suppose, you have
so, when you run
do.call(rbind, matrices_in_list)
, then it is equivalent to:You can call
cbind
to bind your matrices by column.