la2a {str2str} | R Documentation |
List of (3D+) Arrays to (3D+) Array
Description
la2a
converts a list of (3D+) arrays to a one dimension larger (3D+)
array where the list dimension becomes the additional dimension of the array.
la2a
is a simple wrapper function for abind::abind
. If you have
a list of matrices, then use lm2a
.
Usage
la2a(la, dim.order = 1:(ndim(la[[1]]) + 1L), dimlab.list = NULL, check = TRUE)
Arguments
la |
list of 3D+ arrays which each have the same dimensions. |
dim.order |
integer vector of length = |
dimlab.list |
character vector of length 1 specifying the dimlabel for the list dimension. |
check |
logical vector of length 1 specifying whether to check the structure
of the input arguments. For example, check whether |
Value
3D+ array where the list elements of la
is now a dimension. The
order of the dimensions is determined by the argument dim.order
. The
dimnames of the returned array is determined by the dimnames in la[[1]]
and names(la)
.
Examples
la <- list("one" = HairEyeColor, "two" = HairEyeColor*2, "three" = HairEyeColor*3)
la2a(la) # default
la2a(la, dimlab.list = "Multiple")
la2a(la, dim.order = c(4,3,1,2))
la2a(la, dim.order = c(4,3,1,2), dimlab.list = "Multiple")