any                   package:base                   R Documentation

_A_r_e _S_o_m_e _V_a_l_u_e_s _T_r_u_e?

_D_e_s_c_r_i_p_t_i_o_n:

     Given a set of logical vectors, are any of the values true?

_U_s_a_g_e:

     any(..., na.rm = FALSE)

_A_r_g_u_m_e_n_t_s:

     ...: one or more logical vectors.  Other objects are coerced in a
          similar way as 'as.logical.default'.

   na.rm: logical.  If true 'NA' values are removed before the result
          is computed.

_D_e_t_a_i_l_s:

     This is a generic function: methods can be defined for it directly
     or via the 'Summary' group generic. For this to work properly, the
     arguments '...' should be unnamed.

_V_a_l_u_e:

     Given a sequence of logical arguments, a logical value indicating
     whether or not any of the elements of 'x' are 'TRUE'.

     The value returned is 'TRUE' if any of the values in 'x' are
     'TRUE', and 'FALSE' if all of the values in 'x' are 'FALSE'.

     If 'na.rm = FALSE' and 'x' consists of a mix of 'FALSE' and 'NA'
     values, the value is 'NA'.

_N_o_t_e:

     Prior to R 2.1.0, only 'NULL' and logical, integer, numeric and
     complex vectors were accepted.

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'all', the "complement" of 'any'.

_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")

