is.language               package:base               R Documentation

_I_s _a_n _O_b_j_e_c_t _a _L_a_n_g_u_a_g_e _O_b_j_e_c_t?

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

     'is.language' returns 'TRUE' if 'x' is either a variable 'name', a
     'call', or an 'expression'.

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

     is.language(x)

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

       x: object to be tested.

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

     'is.language' is generic: you can write methods to handle specific
     classes of objects, see InternalMethods.

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

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

     ll <- list(a = expression(x^2 - 2*x + 1), b = as.name("Jim"),
                c = as.expression(exp(1)), d = call("sin", pi))
     sapply(ll, typeof)
     sapply(ll, mode)
     stopifnot(sapply(ll, is.language))

