Given a matrix or data.frame
x
, t
returns the transpose of x
.
t(x)
Arguments x
a matrix or data frame, typically.
DetailsThis is a generic function for which methods can be written. The description here applies to the default and "data.frame"
methods.
A data frame is first coerced to a matrix: see as.matrix
. When x
is a vector, it is treated as a column, i.e., the result is a 1-row matrix.
A matrix, with dim
and dimnames
constructed appropriately from those of x
, and other attributes except names copied across.
The conjugate transpose of a complex matrix A
, denoted A^H
or A^*
, is computed as Conj(t(A))
.
Becker RA, Chambers JM, Wilks AR (1988). The New S Language. Chapman and Hall/CRC, London.
See Alsoaperm
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(! all(a[, j] == ta[j, ])) stop("wrong transpose")
[Package
baseversion 4.6.0
Index]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4