triplet                 package:spam                 R Documentation

_T_r_a_n_s_f_o_r_m _a _s_p_a_m _f_o_r_m_a_t _t_o _t_r_i_p_l_e_t_s

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

     Returns a list containing the indices and elements of a  'spam'
     object.

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

     triplet(x, tri=FALSE)

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

       x: sparse matrix of class 'spam' or a matrix.

     tri: Boolean indicating whether to create individual row and
          column  indices vectors.

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

     The elements are row (column) first if 'x' is a 'spam' object
     (matrix).

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

     A list with elements  

 indices: a by two matrix containing the indices if 'tri=FALSE'.

     i,j: vectors  containing the row and column indices if 'tri=TRUE'.

  values: a vector containing the matrix elements

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

     Reinhard Furrer

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

     'spam.list' for the inverse operation and 'foreign' for other
     transformations.

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

     x <- diag.spam(1:4)
     x[2,3] <- 5
     triplet(x)
     all.equal( spam(triplet(x, tri=TRUE)), x)

