home *** CD-ROM | disk | FTP | other *** search
-
- _A_r_e _A_l_l / _A_n_y _V_a_l_u_e_s _T_r_u_e?
-
- all(x)
- any(x)
-
- _V_a_l_u_e:
-
- Given a single logical argument, all returns a logical
- value indicating whether or not all of the elements of
- x are TRUE. The value returned is TRUE if all the
- values in x are TRUE, and FALSE if any the values in x
- are FALSE. If x consists of a mix of TRUE and NA
- values, then all returns NA.
-
- Given a single logical argument, any returns a logical
- value indicating whether or not any of the elements of
- x are TRUE. The value returned is TRUE if any the
- values in x are TRUE, and FALSE if all the values in x
- are FALSE. If x consists of a mix of FALSE and NA
- values, then any returns NA.
-
- _E_x_a_m_p_l_e_s:
-
- range(x <- sort(round(rnorm(10) - 1.2,1)))
- if(any(x < 0)) cat("x contains negative values\n")
- if(all(x < 0)) cat("all x values are negative\n")
-
-