home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-M / help / base / aperm < prev    next >
Encoding:
Text File  |  1997-04-23  |  935 b   |  37 lines

  1.     
  2.     _A_r_r_a_y _T_r_a_n_s_p_o_s_i_t_i_o_n
  3.     
  4.          aperm(a, perm, resize=TRUE)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.                a : the array to be transposed.
  9.     
  10.             perm : the subscript permutation vector.
  11.     
  12.           resize : a flag indicating whether the vector should
  13.                    be resized as well as having its elements
  14.                    reordered (default TRUE.)
  15.     
  16.     _V_a_l_u_e:
  17.     
  18.          A transposed version of array a, with subscripts per-
  19.          muted as indicated by the array perm.  If resize is
  20.          TRUE, the matrix is reshaped as well as having its ele-
  21.          ments permuted.
  22.     
  23.          The function t provides a faster and more convenient
  24.          way of transposing matrices.
  25.     
  26.     _S_e_e _A_l_s_o:
  27.     
  28.          t.
  29.     
  30.     _E_x_a_m_p_l_e_s:
  31.     
  32.          # interchange the first two subscripts on a 3-way array x
  33.          x  <- array(1:24, 2:4)
  34.          xt <- aperm(x, c(2,1,3))
  35.          all(t(xt[,,2]) == x[,,2] )
  36.     
  37.