is.recursive              package:base              R Documentation

_I_s _a_n _O_b_j_e_c_t _A_t_o_m_i_c _o_r _R_e_c_u_r_s_i_v_e?

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

     'is.atomic' returns 'TRUE' if 'x' is an atomic vector (or 'NULL')
     and 'FALSE' otherwise.

     'is.recursive' returns 'TRUE' if 'x' has a recursive (list-like)
     structure and 'FALSE' otherwise.

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

     is.atomic(x)
     is.recursive(x)

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

       x: object to be tested.

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

     These are generic: you can write methods to handle specific
     classes of objects, see InternalMethods.  The description here
     applies only to the default method.

     'is.atomic' is true for the atomic vector types ('"logical"',
     '"integer"', '"numeric"', '"complex"', '"character"' and '"raw"')
     and 'NULL'.

     Most types of language objects are regarded as recursive: those
     which are not are the atomic vector types, 'NULL' and symbols (as
     given by 'as.name').

_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:

     'is.list', 'is.language', etc, and the 'demo("is.things")'.

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

     is.a.r <- function(x) c(is.atomic(x), is.recursive(x))

     is.a.r(c(a=1,b=3))      # TRUE FALSE
     is.a.r(list())          # FALSE TRUE ??
     is.a.r(list(2))         # FALSE TRUE
     is.a.r(lm)              # FALSE TRUE
     is.a.r(y ~ x)           # FALSE TRUE
     is.a.r(expression(x+1)) # FALSE TRUE (not in 0.62.3!)

