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:

     A data frame is first coerced to a matrix: see 'as.matrix'. When
     'x' is a vector, it is treated as "column", i.e., the result is a
     1-row matrix.

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

