

environment {base}                           R Documentation

_E_n_v_i_r_o_n_m_e_n_t _A_c_c_e_s_s

_U_s_a_g_e_:

     environment(fun = NULL)
     environment(fun) <- value
     is.environment(obj)
     .GlobalEnv
     new.env()

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

     fun: a `function' or `NULL', which is the default.

_V_a_l_u_e_:

     If `fun' is a function then `environment(fun)' returns
     the environment associated with that function.  If
     `fun' is `NULL' then the global environment, `.Glob-
     alEnv', is returned. This variable is currently defined
     as `globalenv()'.

     `new.env' returns a new (empty) environment enclosed in
     the parent's environment.

     The assignment form sets the environment of the func-
     tion `fun' to the `value' given.  `is.environment(obj)'
     returns `TRUE' iff `obj' is an `environment'.

_S_e_e _A_l_s_o_:

     The `envir' argument of `eval'.

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

     ##-- all three give the same:
     environment()
     environment(environment)
     .GlobalEnv

     ls(envir=environment(approxfun(1:2,1:2, method="const")))

     is.environment(.GlobalEnv)# T

