all-methods              package:Matrix              R Documentation

"_M_a_t_r_i_x" _M_e_t_h_o_d_s _f_o_r _F_u_n_c_t_i_o_n_s _a_l_l() _a_n_d _a_n_y()

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

     The basic R functions 'all' and 'any' now have methods for
     'Matrix' objects and should behave as for 'matrix' ones.

_M_e_t_h_o_d_s:


     _a_l_l 'signature(x = "Matrix", ..., na.rm = FALSE)': ...

     _a_n_y 'signature(x = "Matrix", ..., na.rm = FALSE)': ...

     _a_l_l 'signature(x = "ldenseMatrix", ..., na.rm = FALSE)': ...

     _a_l_l 'signature(x = "lsparseMatrix", ..., na.rm = FALSE)': ...

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

     M <- Matrix(1:12 +0, 3,4)
     all(M >= 1) # TRUE
     any(M < 0 ) # FALSE
     MN <- M; MN[2,3] <- NA; MN
     all(MN >= 0) # NA
     any(MN <  0) # NA
     any(MN <  0, na.rm = TRUE) # -> FALSE

