t                    package:base                    R Documentation

_M_a_t_r_i_x _T_r_a_n_s_p_o_s_e

_D_e_s_c_r_i_p_t_i_o_n:

     Given a matrix or 'data.frame' 'x', 't' returns the transpose of
     'x'.

_U_s_a_g_e:

     t(x)

_A_r_g_u_m_e_n_t_s:

       x: a matrix or data frame, typically.

_D_e_t_a_i_l_s:

     This 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.

_V_a_l_u_e:

     A matrix, with 'dim' and 'dimnames' constructed appropriately from
     those of 'x', and other attributes except names copied across.

_N_o_t_e:

     The _conjugate_ transpose of a complex matrix A, denoted A^H or
     A^*, is computed as 'Conj(t(A))'.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'aperm' for permuting the dimensions of arrays.

_E_x_a_m_p_l_e_s:

     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")

