remove                 package:base                 R Documentation

_R_e_m_o_v_e _O_b_j_e_c_t_s _f_r_o_m _a _S_p_e_c_i_f_i_e_d _E_n_v_i_r_o_n_m_e_n_t

_D_e_s_c_r_i_p_t_i_o_n:

     `remove' and `rm' can be used to remove objects.  These can be
     specified successively as character strings, or in the character
     vector `list', or through a combination of both.  All objects thus
     specified will be removed.

     If `envir' is NULL then the the currently active environment is
     searched first.

     If `inherits' is `TRUE' then parents of the supplied directory are
     searched until a variable with the given name is encountered.  A
     warning is printed for each variable that is not found.

_U_s_a_g_e:

     remove(..., list = character(0), pos = -1, envir = pos.to.env(pos),
            inherits = FALSE)
     rm    (..., list = character(0), pos = -1, envir = pos.to.env(pos),
            inherits = FALSE)

_S_e_e _A_l_s_o:

     `ls', `objects'

_E_x_a_m_p_l_e_s:

     tmp <- 1:4
     ## work with tmp  and cleanup
     rm(tmp)


     ## remove (almost) everything in the working environment.
     ## You will get no warning, so don't do this unless you are really sure.
     rm(list = ls())

