t {base} | R Documentation |
Given a matrix or data.frame
x
,
t
returns the transpose (matrix or data.frame) of x
.
t(x)
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")