bindArr: concatenate multiple arrays/matrices

View source: R/bindArr.r

bindArrR Documentation

concatenate multiple arrays/matrices

Description

concatenate multiple 3-dimensional arrays and/or 2-dimensional matrices to one big array

Usage

bindArr(..., along = 1, collapse = FALSE)

Arguments

...

matrices and/or arrays with appropriate dimensionality to combine to one array, or a single list containing suitable matrices, or arrays).

along

dimension along which to concatenate.

collapse

logical: if the resulting array is shallow (only 1 dimension deep), it is converted to a matrix.

Details

dimnames, if present and if differing between entries, will be concatenated, separated by a "_".

Value

returns array of combined matrices/arrays

See Also

cbind, rbind, array

Examples


A <- matrix(rnorm(18),6,3)
B <- matrix(rnorm(18),6,3)
C <- matrix(rnorm(18),6,3)

#combine to 3D-array
newArr <- bindArr(A,B,C,along=3)
#combine along first dimension
newArr2 <- bindArr(newArr,newArr,along=1)




Morpho documentation built on June 22, 2024, 7:19 p.m.