dimension {magic}R Documentation

Generalized row and col

Description

Given an array, returns an array of the same size whose elements are sequentially numbered along the i-th dimension.

Used by magiccube.2np1.

Usage

dimension(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 (n1,n2, ..., n_d) being n_i.

Author(s)

Robin K. S. Hankin

Examples

a <- array(0,c(3,3,2,2))
dimension(a,2)
(dimension(a,1)+dimension(a,2)+dimension(a,3)+dimension(a,4))%%2


[Package Contents]