1\name{process}
2\alias{process}
3\title{Force index arrays into range}
4\description{
5Forces an (integer) array to have entries in the range 1-n, by (i)
6taking the entries modulo n, then (ii) setting zero elements to n.
7Useful for modifying index arrays into a form suitable for use with
8magic squares.}
9\usage{
10process(x, n)
11}
12\arguments{
13  \item{x}{Index array to be processed}
14  \item{n}{Modulo of arithmetic to be used}
15}
16\author{Robin K. S. Hankin}
17\examples{
18# extract the broken diagonal of magic.2np1(4) that passes
19# through element [1,5]:
20
21a <- magic.2np1(4)
22index <- t(c(1,5)+rbind(1:9,1:9))
23a[process(index,9)]
24}
25\keyword{array}
26