rm(base)
rm()所属R语言包:base
Remove Objects from a Specified Environment
从指定的环境中删除对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
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.
remove和rm可以用来删除对象。这些可以指定先后为字符串,或在特征向量list,或通过两者的结合。指定的所有对象将被删除。
If envir is NULL then the currently active environment is searched first.
envir如果是NULL,那么目前活跃的环境中首先搜索。
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.
如果inherits是TRUE然后家长提供目录搜索,直到遇到一个给定的名称的变量。每个变量没有找到一个警告被打印。
用法----------Usage----------
remove(..., list = character(), pos = -1,
envir = as.environment(pos), inherits = FALSE)
rm (..., list = character(), pos = -1,
envir = as.environment(pos), inherits = FALSE)
参数----------Arguments----------
参数:...
the objects to be removed, as names (unquoted) or character strings (quoted).
被删除的对象,作为名(不带引号)或字符串(引)。
参数:list
a character vector naming objects to be removed.
要删除一个字符向量命名的对象。
参数:pos
where to do the removal. By default, uses the current environment. See "details" for other possibilities.
在那里做删除。默认情况下,使用当前的环境。看到其他的可能性“细节”。
参数:envir
the environment to use. See "details".
environment使用。看到“细节”。
参数:inherits
should the enclosing frames of the environment be inspected?
环境封闭的框架应进行检查?
Details
详情----------Details----------
The pos argument can specify the environment from which to remove the objects 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.
作为在搜索中的一个元素的字符串名称环境pos参数可以指定从其中删除任何在以下几个方面的对象:作为一个整数(search列表中的位置);列表;或environment(包括使用sys.frame访问当前活跃的函数调用)。论据是envir另一种方式来指定一个环境,但主要是为后面的兼容性有。
It is not allowed to remove variables from the base environment and base namespace, nor from any environment which is locked (see lockEnvironment).
这是不允许的,从基地环境和基地命名空间中删除,也没有任何被锁定的环境变量(见lockEnvironment)。
Earlier versions of R incorrectly claimed that supplying a character vector in ... removed the objects named in the character vector, but it removed the character vector. Use the list argument to specify objects via a character vector.
研发的早期版本错误地声称,提供一个字符向量...删除特征向量的名字命名的对象,但它去掉了特征向量。使用list参数指定对象通过特征向量。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
ls, objects
ls,objects
举例----------Examples----------
tmp <- 1:4
## work with tmp and cleanup[#tmp和清理工作]
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())
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|