EVOLUTION-MANAGER
Edit File: rm.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Remove Objects from a Specified Environment</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for remove {base}"><tr><td>remove {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Remove Objects from a Specified Environment</h2> <h3>Description</h3> <p><code>remove</code> and <code>rm</code> can be used to remove objects. These can be specified successively as character strings, or in the character vector <code>list</code>, or through a combination of both. All objects thus specified will be removed. </p> <p>If <code>envir</code> is NULL then the currently active environment is searched first. </p> <p>If <code>inherits</code> is <code>TRUE</code> 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. </p> <h3>Usage</h3> <pre> remove(..., list = character(), pos = -1, envir = as.environment(pos), inherits = FALSE) rm (..., list = character(), pos = -1, envir = as.environment(pos), inherits = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>the objects to be removed, as names (unquoted) or character strings (quoted).</p> </td></tr> <tr valign="top"><td><code>list</code></td> <td> <p>a character vector naming objects to be removed.</p> </td></tr> <tr valign="top"><td><code>pos</code></td> <td> <p>where to do the removal. By default, uses the current environment. See ‘details’ for other possibilities.</p> </td></tr> <tr valign="top"><td><code>envir</code></td> <td> <p>the <code><a href="environment.html">environment</a></code> to use. See ‘details’.</p> </td></tr> <tr valign="top"><td><code>inherits</code></td> <td> <p>should the enclosing frames of the environment be inspected?</p> </td></tr> </table> <h3>Details</h3> <p>The <code>pos</code> argument can specify the environment from which to remove the objects in any of several ways: as an integer (the position in the <code><a href="search.html">search</a></code> list); as the character string name of an element in the search list; or as an <code><a href="environment.html">environment</a></code> (including using <code><a href="sys.parent.html">sys.frame</a></code> to access the currently active function calls). The <code>envir</code> argument is an alternative way to specify an environment, but is primarily there for back compatibility. </p> <p>It is not allowed to remove variables from the base environment and base namespace, nor from any environment which is locked (see <code><a href="bindenv.html">lockEnvironment</a></code>). </p> <p>Earlier versions of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> incorrectly claimed that supplying a character vector in <code>...</code> removed the objects named in the character vector, but it removed the character vector. Use the <code>list</code> argument to specify objects <em>via</em> a character vector. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="ls.html">ls</a></code>, <code><a href="ls.html">objects</a></code> </p> <h3>Examples</h3> <pre> tmp <- 1:4 ## work with tmp and cleanup rm(tmp) ## Not run: ## 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()) ## End(Not run)</pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>