foreign                 package:spam                 R Documentation

_T_r_a_n_s_f_o_r_m_a_t_i_o_n _t_o _o_t_h_e_r _s_p_a_r_s_e _f_o_r_m_a_t_s

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

     Transform between the 'spam' sparse format to the 'matrix.csr'
     format of 'SparseM' and  'dgRMatrix' format of 'Matrix'

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

     as.spam.matrix.csr(x)
     # as.matrix.csr.spam(x)
     as.dgRMatrix.spam(x)
     as.dgCMatrix.spam(x)
     as.spam.dgRMatrix(x)
     as.spam.dgCMatrix(x)

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

       x: sparse matrix of class 'spam', 'matrix.csr', 'dgRMatrix' or
          'dgCMatrix'.

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

     We do not provide any 'S4' methods and because of the existing
     mechanism a standard 'S3' does not work.

     The functions are based on 'require'.

     Notice that 'as.matrix.csr.spam' should read as
     'as."matrix.csr".spam'.

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

     According to the call, a sparse matrix of class  'spam',
     'matrix.csr', 'dgRMatrix' or 'dgCMatrix'.

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

     Reinhard Furrer

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

     'triplet', 'Matrix' or   'matrix.csr'

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

     ## Not run: 
     S <- diag.spam(4)
     U <- as.matrix.csr.spam( S) 
     R <- as.dgRMatrix.spam( S) 
     C <- as.dgCMatrix.spam( S)
     as.spam.dgCMatrix(C) 
     slotNames(U)
     slotNames(R)
     # For column oriented sparse formats a transpose does not the job,
     # as the slot names change.

     # as.spam(R) does not work.
     ## End(Not run)

     ## Not run: 
     # a dataset contained in Matrix
     data(KNex)
     as.spam.dgCMatrix(KNex$mm) 

     ## End(Not run)

