Maybe something like this
list3 <- list(1,2,3,4)
list4 <- list(5,6,7,8)
listall <- append(list3, list4)
array(listall, c(2, length(listall) / 2))
exits
[,1] [,2] [,3] [,4]
[1,] 1 3 5 7
[2,] 2 4 6 8
For this reason you can look in the docs
?array
Usage
array(data = NA, dim = length(data), dimnames = NULL)
...
So, you passed your second list ( list4in your example) as a parameterdim
source
share