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-I / help / base / row < prev    next >
Encoding:
Text File  |  1997-04-23  |  660 b   |  32 lines

  1.     
  2.     _R_o_w _I_n_d_e_x_e_s
  3.     
  4.          row(x, as.factor=FALSE)
  5.     
  6.     _A_r_g_u_m_e_n_t_s:
  7.     
  8.                x : a matrix.
  9.     
  10.        as.factor : a logical value indicating whether the value
  11.                    should be returned as a factor rather than as
  12.                    numeric.
  13.     
  14.     _V_a_l_u_e:
  15.     
  16.          An integer matrix with the same dimensions as x and
  17.          whose ij-th element is equal to i.
  18.     
  19.     _S_e_e _A_l_s_o:
  20.     
  21.          col to get columns.
  22.     
  23.     _E_x_a_m_p_l_e_s:
  24.     
  25.          # extract the diagonal of a matrix
  26.          dx <- x[row(x)==col(x)]
  27.     
  28.          # create an identity 5-by-5 matrix
  29.          x <- matrix(0,nr=5,nc=5)
  30.          x[row(x)==col(x)] <- 1
  31.     
  32.