Learn R Programming

Morpho (version 2.12)

bindArr: 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)

Value

returns array of combined matrices/arrays

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 "_".

See Also

Examples

Run this code

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)



Run the code above in your browser using DataLab