magic (version 1.5-9)

arow: Generalized row and col

Description

Given an array, returns an array of the same size whose elements are sequentially numbered along the \(i^{\rm th}\) dimension.

Usage

arow(a, i)

Arguments

a

array to be converted

i

Number of the dimension

Value

An integer matrix with the same dimensions as a, with element \(\left(n_1,n_2,\ldots n_d\right)\) being \(n_i\).

Examples

Run this code
# NOT RUN {
a <- array(0,c(3,3,2,2))
arow(a,2)
(arow(a,1)+arow(a,2)+arow(a,3)+arow(a,4))%%2

# }

Run the code above in your browser using DataLab