nMatrix-class package:Matrix R Documentation _C_l_a_s_s "_n_M_a_t_r_i_x" _o_f _N_o_n-_z_e_r_o _P_a_t_t_e_r_n _M_a_t_r_i_c_e_s _D_e_s_c_r_i_p_t_i_o_n: The 'nMatrix' class is the virtual "mother" class of all _*n*on-zero pattern_ (or simply _patter*n*_) matrices in the 'Matrix' package. _S_l_o_t_s: Common to _all_ matrix object in the package: '_D_i_m': Object of class '"integer"' - the dimensions of the matrix - must be an integer vector with exactly two non-negative values. '_D_i_m_n_a_m_e_s': list of length two; each component containing NULL or a 'character' vector length equal the corresponding 'Dim' element. _M_e_t_h_o_d_s: There is a bunch of coercion methods (for 'as(..)'), e.g., _c_o_e_r_c_e 'signature(from = "nMatrix", to = "matrix")': ... _c_o_e_r_c_e 'signature(from = "nMatrix", to = "dMatrix")': ... _c_o_e_r_c_e 'signature(from = "nMatrix", to = "lMatrix")': ... _c_o_e_r_c_e 'signature(from = "matrix", to = "nMatrix")': Note that these coercions (must) coerce 'NA's to non-zero, hence conceptually 'TRUE'. This is particularly important when 'sparseMatrix' objects are coerced to '"nMatrix"' and hence to 'nsparseMatrix'. _c_o_e_r_c_e 'signature(from = "dMatrix", to = "nMatrix")': ... _c_o_e_r_c_e 'signature(from = "lMatrix", to = "nMatrix")': ... _S_e_e _A_l_s_o: The classes 'lMatrix', 'nsparseMatrix', and the mother class, 'Matrix'. _E_x_a_m_p_l_e_s: getClass("nMatrix") L3 <- Matrix(upper.tri(diag(3))) L3 # an "ltCMatrix" as(L3, "nMatrix") # -> ntC* ## similar, not using Matrix() as(upper.tri(diag(3)), "nMatrix")# currently "ngTMatrix"