Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Array2Vector

Transforming an array to a vector


Description

Transform a N-dimensional array a to vector. The transformation is done assuming that the last index of the array moves fastest. For instance, an array a of dimensions (2,2,2) will produce the vector v = ( a[1,1,1], a[1,1,2], a[1,1,3], a[1,2,1], a[1,2,2],…,a[3,3,3]).

Usage

Array2Vector(arr)

Arguments

arr

The array to be transformed.

Value

A vector filled with the data of the input array arr.

Author(s)

Thomas Suesse.

Maintainer: Johan Barthelemy johan@uow.edu.au.

See Also

The inverse transformation is performed with the function Vector2Array

Examples

# generating an array of dimension (3,3,3)
a <- array(seq(1:27),dim=c(3,3,3))
# transforming it into a vector
v <- Array2Vector(a)

mipfp

Multidimensional Iterative Proportional Fitting and Alternative Models

v3.2.1
GPL-2
Authors
Johan Barthelemy [aut, cre], Thomas Suesse [aut], Mohammad Namazi-Rad [ctb]
Initial release
2018-08-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.