abind: Bind comformable arrays

View source: R/tab.R

abindR Documentation

Bind comformable arrays

Description

abind binds two conformable arrays along a dimension.

Usage

abind(arr1, arr2, d, facename = "")

Arguments

arr1

first array

arr2

second array

d

dimension along which arr1 and arr2 are joined, or, if the length(dim(arr1)) == length(dim(arr2)) + 1 the dimension in arr1 that is extended by arr2.

facename

Name for the new array dimension

Details

Warning: abind::abind should be preferred to spida2::abind.

dim( arr1 ) and dim( arr2 ) must be equal except in the dth dimension. If the length of dim( arr2 ) is 1 less than that of dim( arr1 ), then 'arr2' is treated as if it had dropped the dth dimension with size 1.

If length(dim(arr2)) == length(dim(arr1)) - 1, then arr2 is treated as if it dropped a dimension of size 1 in the dth dimension. 'facename' is used as the name of the dimnames list for this dimension.

Value

The returned value, ret, is an array with dimension dim(arr1) except for the dth dimension where dim(ret)d == dim(arr1)d + dim(arr2)d.

Author(s)

Georges Monette

See Also

aperm, to permute arrays


gmonette/spida2 documentation built on Aug. 11, 2024, 7:52 p.m.