Description Usage Arguments Details Value Author(s) Examples

Given an array `X`

and a vector of integers `m`

,
`collapse_mode`

returns an array of lower order where the
first mode indexes the modes indicated in `m`

.

1 | ```
collapse_mode(X, m)
``` |

`X` |
An array whose modes we are collapsing. |

`m` |
A vector of integers giving the modes to collapse. |

Transforms an array into another array where the provided modes are
collapsed into one mode. The indexing along this new mode is in
lexicographical order of the indices of the collapsed modes. The
collapsed mode is the first mode unless `length(m) == 1`

, then
`collapse_mode`

simply returns `X`

.

If *X* is of order *K* and `length(m) = q`

,
then returns an array *Y* of order *K - q + 1*, where
the modes indicated in `m`

are combined to be the first
mode in *Y*.

David Gerard.

1 2 3 4 5 6 | ```
X <- array(rep(c(1, 2), 8), dim = c(2, 2, 2, 2))
X
#mode 1 is now mode 2, modes 2, 3, and 4 are combined to be mode 1.
collapse_mode(X, c(2, 3, 4))
collapse_mode(X, c(2, 4)) ## another example.
collapse_mode(X, 4) #returns X
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.