\HeaderA{t}{Matrix Transpose}{t}
\methaliasA{t.data.frame}{t}{t.data.frame}
\methaliasA{t.default}{t}{t.default}
\keyword{array}{t}
\begin{Description}\relax
Given a matrix or \code{\LinkA{data.frame}{data.frame}} \code{x},
\code{t} returns the transpose of \code{x}.
\end{Description}
\begin{Usage}
\begin{verbatim}
t(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a matrix or data frame, typically.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This is a generic function for which methods can be written.  The
description here applies to the default and \code{"data.frame"} methods.

A data frame is first coerced to a matrix: see \code{\LinkA{as.matrix}{as.matrix}}.
When \code{x} is a vector, it is treated as a column, i.e., the
result is a 1-row matrix.
\end{Details}
\begin{Value}
A matrix, with \code{dim} and \code{dimnames} constructed
appropriately from those of \code{x}, and other attributes except
names copied across.
\end{Value}
\begin{Note}\relax
The \emph{conjugate} transpose of a complex matrix \eqn{A}{}, denoted
\eqn{A^H}{} or \eqn{A^*}{}, is computed as \code{\LinkA{Conj}{Conj}(t(A))}.
\end{Note}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{aperm}{aperm}} for permuting the dimensions of arrays.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
a <- matrix(1:30, 5,6)
ta <- t(a) ##-- i.e.,  a[i, j] == ta[j, i] for all i,j :
for(j in seq(ncol(a)))
  if(! all(a[, j] == ta[j, ])) stop("wrong transpose")
\end{ExampleCode}
\end{Examples}

