\HeaderA{nrow}{The Number of Rows/Columns of an Array}{nrow}
\aliasA{NCOL}{nrow}{NCOL}
\aliasA{ncol}{nrow}{ncol}
\aliasA{NROW}{nrow}{NROW}
\keyword{array}{nrow}
\begin{Description}\relax
\code{nrow} and \code{ncol} return the number of rows or columns
present in \code{x}.
\code{NCOL} and \code{NROW} do the same treating a vector as
1-column matrix.
\end{Description}
\begin{Usage}
\begin{verbatim}
nrow(x)
ncol(x)
NCOL(x)
NROW(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a vector, array or data frame
\end{ldescription}
\end{Arguments}
\begin{Value}
an \code{\LinkA{integer}{integer}} of length 1 or \code{\LinkA{NULL}{NULL}}.
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole (\code{ncol} and \code{nrow}.)
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{dim}{dim}} which returns \emph{all} dimensions;
\code{\LinkA{array}{array}}, \code{\LinkA{matrix}{matrix}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
ma <- matrix(1:12, 3, 4)
nrow(ma)   # 3
ncol(ma)   # 4

ncol(array(1:24, dim = 2:4)) # 3, the second dimension
NCOL(1:12) # 1
NROW(1:12) # 12
\end{ExampleCode}
\end{Examples}

