pos.to.env               package:base               R Documentation

_C_o_n_v_e_r_t _P_o_s_i_t_i_o_n_s _i_n _t_h_e _S_e_a_r_c_h _P_a_t_h _t_o _E_n_v_i_r_o_n_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Returns the environment at a specified position in the search
     path.

_U_s_a_g_e:

     pos.to.env(x)

_A_r_g_u_m_e_n_t_s:

       x: an integer between 1 and 'length(search())', the length of
          the search path.

_D_e_t_a_i_l_s:

     Several R functions for manipulating objects in environments (such
     as 'get' and 'ls') allow specifying environments via corresponding
     positions in the search path.  'pos.to.env' is a convenience
     function for programmers which converts these positions to
     corresponding environments; users will typically have no need for
     it.

_E_x_a_m_p_l_e_s:

     pos.to.env(1) # R_GlobalEnv
     # the next returns NULL, which is how package:base is represented.
     pos.to.env(length(search()))

