cBind                 package:Matrix                 R Documentation

_V_e_r_s_i_o_n_s _o_f '_c_b_i_n_d' _a_n_d '_r_b_i_n_d' _r_e_c_u_r_s_i_v_e_l_y _b_u_i_l_t _o_n _c_b_i_n_d_2/_r_b_i_n_d_2

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

     The base functions 'cbind' and 'rbind' are defined for an
     arbitrary number of arguments and hence have the first formal
     argument '...'.  For that reason, S4 methods cannot easily be
     defined for binding together matrices inheriting from 'Matrix'.

     For that reason, 'cbind2' and 'rbind2' have been provided for
     binding together _two_ matrices, and we have defined methods for
     these and the ''Matrix''-matrices.

     As a substitute for _S4-enabled_ versions of 'cbind' and 'rbind',
     you can use 'cBind' and 'rBind' with identical syntax and semantic
     in order to bind together multiple matrices ('"matrix"' or
     '"Matrix"' and vectors.

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

     cBind(..., deparse.level = 1)
     rBind(..., deparse.level = 1)

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

     ...: matrix-like R objects to be bound together, see 'cbind' and
          'rbind'.

deparse.level: integer determining under which circumstances column and
          row names are built from the actual arguments' expression,
          see 'cbind'.

_D_e_t_a_i_l_s:

     The implementation of these is _recursive_, calling 'cbind2' or
     'rbind2' respectively, where these have methods defined and so
     should dispatch appropriately.

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

     typically a matrix-like object of a similar 'class' as the first
     argument in '...'.

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

     Martin Maechler

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

     'cbind2', 'cbind', 'Methods'.

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

     (a <- matrix(c(2:1,1:2), 2,2))
     cbind(0, rBind(a, 7)) # remains traditional matrix

     D <- Diagonal(2)
     cBind(4, a, D, -1, D, 0) # a sparse Matrix

