t {base} | R Documentation |
Given a matrix or data.frame
x
,
t
returns the transpose (matrix or data.frame) of x
.
t(x)
x |
a matrix or data frame. |
aperm
for permuting the dimensions of arrays.
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(! a[, j] == ta[j, ]) stop("wrong transpose")