t
Transpose a Matrix

Description

Transposes a matrix, a data frame, or a vector. This is a generic function.

Usage

t(x)
t.default(x)

Arguments

x a matrix, data frame, or vector. If x is a matrix, it is simply transposed. If x is data frame, first it is converted to a matrix, and then it is transposed. If x is a vector, it is treated as a column. Missing values (NAs) are allowed.

Details

For the generalized transpose of arrays, see aperm. For the inverse of a matrix, see solve.
Value
returns a matrix that is the transpose of x. Rows of x are columns of the result, so that t(x)[j, i] is the same as x[i, j].
See Also
aperm, solve
Examples
amat <- matrix(1:12,3)
t(amat)

t(1:10)

Package base version 6.0.0-69
Package Index