diagX                package:sfsmisc                R Documentation

_T_h_e "_O_t_h_e_r" _D_i_a_g_o_n_a_l _M_a_t_r_i_x

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

     Compute the _other_ diagonal identity matrix. The result is
     basically a _fast_ version of 'diag(n)[, n:1]'.

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

     diagX(n)

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

       n: positive integer.

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

     a numeric n * n matrix with many zeros - apart from '1's in the
     _other_ diagonal.

_A_u_t_h_o_r(_s):

     Martin Maechler, 1992.

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

     'diag'.

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

     diagX(4)
     for(m in 1:5)
       stopifnot(identical(diagX(m), diag(m)[, m:1, drop = FALSE]))

