\Header{array}{Multi-way Arrays}
\alias{as.array}{array}
\alias{is.array}{array}
\keyword{array}{array}
\begin{Description}\relax
Creates or tests for arrays.\end{Description}
\begin{Usage}
\begin{verbatim}
array(x, dim = length(x), dimnames = NULL)
as.array(x)
is.array(x)
\end{verbatim}
\end{Usage}
\begin{Value}
\code{array} returns an array with the extents specified in \code{dim}
and naming information in \code{dimnames}.  The values in \code{x} are
taken to be those in the array with the leftmost subscript moving
fastest.  If there are too few elements in \code{x} to fill the array,
then the elements in \code{x} are recycled.

\code{as.array()} coerces its argument to be an array by attaching a
\code{\Link{dim}} attribute to it.  It also attaches
\code{\Link{dimnames}} if \code{x} has \code{\Link{names}}.
The sole purpose of this is to make it possible to access the
\code{dim}[names] attribute at a later time.

\code{is.array} returns \code{TRUE} or \code{FALSE} depending on
whether its argument is an array (i.e., has a \code{dim} attribute) 
or not.\end{Value}
\begin{SeeAlso}\relax
\code{\Link{aperm}},
\code{\Link{matrix}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
dim(as.array(letters))
array(1:3, c(2,4)) # recycle 1:3 "2 2/3 times"
#     [,1] [,2] [,3] [,4]
#[1,]    1    3    2    1
#[2,]    2    1    3    2
\end{ExampleCode}
\end{Examples}

