AsIs                  package:base                  R Documentation

_I_n_h_i_b_i_t _I_n_t_e_r_p_r_e_t_a_t_i_o_n/_C_o_n_v_e_r_s_i_o_n _o_f _O_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Change the class of an object to indicate that it should be
     treated 'as is'.

_U_s_a_g_e:

     I(x)

_A_r_g_u_m_e_n_t_s:

       x: an object

_D_e_t_a_i_l_s:

     Function 'I' has two main uses.

        *  In function 'data.frame'.  Protecting an object by enclosing
           it in 'I()' in a call to 'data.frame' inhibits the
           conversion of character vectors to factors, and the dropping
           of names.  'I' can also be used to protect objects which are
           to be added to a data frame, or converted to a data frame
           _via_ 'as.data.frame'.

           It achieves this by prepending the class '"AsIs"' to the
           object's classes.  Class '"AsIs"' has a few of its own
           methods, including for '[', 'as.data.frame', 'print' and
           'format'.

        *  In function 'formula'.  There it is used to inhibit the
           interpretation of  operators such as '"+"', '"-"', '"*"' and
           '"^"' as formula operators, so they are used as arithmetical
           operators.  This is interpreted as a symbol by
           'terms.formula'.

_V_a_l_u_e:

     A copy of the object with class '"AsIs"' prepended to the
     class(es).

_R_e_f_e_r_e_n_c_e_s:

     Chambers, J. M. (1992) _Linear models._ Chapter 4 of _Statistical
     Models in S_ eds J. M. Chambers and T. J. Hastie, Wadsworth &
     Brooks/Cole.

_S_e_e _A_l_s_o:

     'data.frame', 'formula'

