home *** CD-ROM | disk | FTP | other *** search
-
- _R_o_w _I_n_d_e_x_e_s
-
- row(x, as.factor=FALSE)
-
- _A_r_g_u_m_e_n_t_s:
-
- x : a matrix.
-
- as.factor : a logical value indicating whether the value
- should be returned as a factor rather than as
- numeric.
-
- _V_a_l_u_e:
-
- An integer matrix with the same dimensions as x and
- whose ij-th element is equal to i.
-
- _S_e_e _A_l_s_o:
-
- col to get columns.
-
- _E_x_a_m_p_l_e_s:
-
- # extract the diagonal of a matrix
- dx <- x[row(x)==col(x)]
-
- # create an identity 5-by-5 matrix
- x <- matrix(0,nr=5,nc=5)
- x[row(x)==col(x)] <- 1
-
-