get                   package:base                   R Documentation

_R_e_t_u_r_n _a _V_a_r_i_a_b_l_e'_s _V_a_l_u_e

_D_e_s_c_r_i_p_t_i_o_n:

     Search for an R object with a given name and return it if found.

_U_s_a_g_e:

     get(x, pos=-1, envir=as.environment(pos), mode="any", inherits=TRUE)

_A_r_g_u_m_e_n_t_s:

       x: a variable name (given as a character string).

     pos: where to look for the object (see the details section); if
          omitted, the function will search, as if the name of the
          object appeared in unquoted in an expression. 

   envir: an alternative way to specify an environment to look in; see
          the details section.

    mode: the mode of object sought.

inherits: should the enclosing frames of the environment be inspected?

_D_e_t_a_i_l_s:

     The 'pos' argument can specify the  environment in which to look
     for the object in any of several ways: as an integer (the position
     in the 'search' list); as the character string name of an element
     in the search list; or as an 'environment' (including using
     'sys.frame' to access the currently active function calls). The
     'envir' argument is an alternative way to specify an environment,
     but is primarily there for back compatibility.

     The 'mode' includes collections such as '"numeric"' and
     '"function"': any member of the collection will suffice.

_V_a_l_u_e:

     This function searches the specified environment for a bound
     variable whose name is given by the character string 'x'.  If the
     variable's value is not of the correct 'mode', it is ignored.

     If 'inherits' is 'FALSE', only the first frame of the specified
     environment is inspected.  If 'inherits' is 'TRUE', the search is
     continued up through the parent frames until a bound value of the
     right mode is found.

     Using a 'NULL' environment is equivalent to using the current
     environment.

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

     'exists'.

_E_x_a_m_p_l_e_s:

     get("%o%")

