Displaying 1 result from an estimated 1 matches for "2x4x5".
2013 Feb 14
3
list of matrices --> array
i'm somehow embarrassed to even ask this, but is there any built-in
method for doing this:
my_list <- list()
my_list[[1]] <- matrix(1:20, ncol = 5)
my_list[[2]] <- matrix(20:1, ncol = 5)
now, knowing that these matrices are identical in dimension, i'd like
to unfold the list to a 2x4x5 (or some other permutation of the dim
sizes) array.
i know i can initialize the array, then loop through my_list to fill
the array, but somehow this seems inelegant.
i also know i can vectorize the matrices and unlist the list, then
build the array from that single vector, but this also seems inele...