bindArrays: Combine several arrays into one large array

Description Usage Arguments Details See Also

View source: R/array_transform.R

Description

bindArrays is just a wrapper around abind.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
bindArrays(
  ...,
  along = NULL,
  rev.along = NULL,
  new.names = NULL,
  force.array = TRUE,
  make.names = use.anon.names,
  use.anon.names = FALSE,
  use.first.dimnames = FALSE,
  hier.names = FALSE,
  along_name = NULL
)

Arguments

...

Any number of vectors, matrices, arrays, or data frames. If the objects have named dimension names, their dimensions are permuted before feeding to abind. Otherwise, the dimensions of all the arrays must match, except on one dimension (specified by along=). If these arguments are named, the name will be used for the name of the dimension along which the arrays are joined. Vectors are treated as having a dim attribute of length one. Alternatively, there can be one (and only one) list argument supplied, whose components are the objects to be bound together. Names of the list components are treated in the same way as argument names.

along

(optional) The dimension along which to bind the arrays. The default is the last dimension, i.e., the maximum length of the dim attribute of the supplied arrays. along= can take any non-negative value up to the minimum length of the dim attribute of supplied arrays plus one. When along= has a fractional value, a value less than 1, or a value greater than N (N is the maximum of the lengths of the dim attribute of the objects to be bound together), a new dimension is created in the result. In these cases, the dimensions of all arguments must be identical.

rev.along

(optional) Alternate way to specify the dimension along which to bind the arrays: along = N + 1 - rev.along. This is provided mainly to allow easy specification of along = N + 1 (by supplying rev.along=0). If both along and rev.along are supplied, the supplied value of along is ignored.

new.names

(optional) If new.names is a list, it is the first choice for the dimnames attribute of the result. It should have the same structure as a dimnames attribute. If the names for a particular dimension are NULL, names for this dimension are constructed in other ways.

If new.names is a character vector, it is used for dimension names in the same way as argument names are used. Zero length ("") names are ignored.

force.array

(optional) If FALSE, rbind or cbind are called when possible, i.e., when the arguments are all vectors, and along is not 1, or when the arguments are vectors or matrices or data frames and along is 1 or 2. If rbind or cbind are used, they will preserve the data.frame classes (or any other class that r/cbind preserve). Otherwise, abind will convert objects to class array. Thus, to guarantee that an array object is returned, supply the argument force.array=TRUE. Note that the use of rbind or cbind introduces some subtle changes in the way default dimension names are constructed: see the examples below.

make.names

(optional) If TRUE, the last resort for dimnames for the along dimension will be the deparsed versions of anonymous arguments. This can result in cumbersome names when arguments are expressions.

<p>The default is FALSE.

use.anon.names

(optional) use.anon.names is a deprecated synonym for make.names.

use.first.dimnames

(optional) When dimension names are present on more than one argument, should dimension names for the result be take from the first available (the default is to take them from the last available, which is the same behavior as rbind and cbind.)

hier.names

(optional) If TRUE, dimension names on the concatenated dimension will be composed of the argument name and the dimension names of the objects being bound. If a single list argument is supplied, then the names of the components serve as the argument names. hier.names can also have values "before" or "after"; these determine the order in which the argument name and the dimension name are put together (TRUE has the same effect as "before").

along_name

a character version of along in abind. Only considered if input arrays have named dimension names, and if conflicts with along, along_name overrides along. If along_name is not among the dimension names, it will be the name of the new dimension name. In this case the position of the new dimension can be controlled by along.

Details

This function calls abind and adds the names of the dimension names of the arrays. If the inputs have named dimension names, their dimensions are permuted before feeding to abind. bindArrays has the same arguments as abind except for along_name, as documented below.

See Also

abind for the original version in package abind; mergeArrays if you have a list of arrays created by splitArray or you want to bind on multiple dimensions; rearrangeList if you want to bind arrays in two-level lists


tdeenes/eegR documentation built on April 19, 2021, 4:17 p.m.