blockdiag              package:mixstock              R Documentation

_B_l_o_c_k _d_i_a_g_o_n_a_l _m_a_t_r_i_c_e_s

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

     Construct a block-diagonal matrix from a list of submatrices.

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

     blockdiag(...)

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

     ...: a comma-separated list of matrix objects that will form the
          submatrices of the block-diagonal matrix. 

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

     A block-diagonal matrix with dimensions equal to the sum of the
     dimensions of the submatrices.

_N_o_t_e:

     If you want to use a previously constructed list of matrices, use
     'do.call' (see the examples). Doesn't preserve names or attributes
     (yet).

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

     Ben Bolker

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

       m1 <- matrix(1,nrow=2,ncol=2)
       m2 <- matrix(2,nrow=1,ncol=3)
       m3 <- matrix(3,nrow=3,ncol=2)
       blockdiag(m1,m2,m3)
       l <- list(m1,m2,m3)
       do.call("blockdiag",l)

