Learn R Programming

multiplex (version 3.7)

zbind: Bind Matrices and Multidimensional Arrays

Description

A function to combine or bind matrices and multidimensional arrays.

Usage

zbind(..., sort, force)

Value

Usually a three dimensional array

Arguments

...

One or more arrays having two or three dimensions

sort

(optional and logical) sort array according to labels?

force

(optional and logical) force binding arrays with different dimensions?

Author

Antonio Rivero Ostoic

Warning

Arrays without dimnames are not fully supported.

Details

Function zbind is for stacking for instance two-dimensional arrays into a single three-dimensional object to represent a multivariate system structure. Both square and rectangular arrays are supported provided that the dimensions in the input are equal, and data frames should be transformed into arrays for the binding. The dimnames in the array output correspond to the names of the first array in the input, and a warning message is given when the dimnames are NULL.

See Also

mnplx, dichot, strings

Examples

Run this code
# create the data: two sets with a pair of binary relations 
# among three elements
arr1 <- round( replace( array( runif(18), c(3 ,3, 2) ), array( runif(18),
        c(3, 3, 2) ) > .5, 3 ) )

arr2 <- round( replace( array( runif(18), c(3 ,3, 2) ), array( runif(18),
        c(3, 3, 2) ) > .5, 3 ) )

# bind the data sets
zbind(arr1, arr2)

Run the code above in your browser using DataLab