apropos(utils)
apropos()所属R语言包:utils
Find Objects by (Partial) Name
(部分)名称查找对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
apropos() returns a character vector giving the names of all objects in the search list matching what.
apropos()返回一个特征向量,匹配what在搜索列表的所有对象的名称。
find() is a different user interface to the same task.
find()不同的用户界面是相同的任务。
用法----------Usage----------
apropos(what, where = FALSE, ignore.case = TRUE, mode = "any")
find(what, mode = "any", numeric = FALSE, simple.words = TRUE)
参数----------Arguments----------
参数:what
character string with name of an object, or more generally a regular expression to match against.
对象的名称,或更普遍的正则表达式匹配的字符串。
参数:where, numeric
a logical indicating whether positions in the search list should also be returned
指示是否在搜索列表中的位置也应该返回逻辑
参数:ignore.case
logical indicating if the search should be case-insensitive, TRUE by default. Note that in R versions prior to 2.5.0, the default was implicitly ignore.case = FALSE.
逻辑表示如果搜索是区分大小写的,TRUE默认。请注意,在R版本2.5.0前,默认是隐含ignore.case = FALSE。
参数:mode
character; if not "any", only objects whose mode equals mode are searched.
字符;如果不是"any"的mode等于mode搜索的对象。
参数:simple.words
logical; if TRUE, the what argument is only searched as whole word.
逻辑,如果TRUE,what参数仅作为整个单词搜索。
Details
详情----------Details----------
If mode != "any" only those objects which are of mode mode are considered. If where is TRUE, the positions in the search list are returned as the names attribute.
如果mode != "any"被认为是只有那些对象模式mode。 where如果是TRUE,在搜索列表中的位置返回的名称属性。
find is a different user interface for the same task as apropos. However, by default (simple.words == TRUE), only full words are searched with grep(fixed = TRUE).
find是一个相同的任务apropos不同的用户界面。然而,默认情况下(simple.words == TRUE),只有完整的单词搜索grep(fixed = TRUE)。
值----------Value----------
For apropos character vector, sorted by name, possibly with names giving the (numerical) positions on the search path.
apropos矢量字符,按名称排序,可能给搜索路径上的位置(数值)的名称。
For find, either a character vector of environment names, or for numeric = TRUE, a numerical vector of positions on the search path, with names giving the names of the corresponding environments.
find,无论是环境名称的字符向量,或numeric = TRUE,数值向量的搜索路径上的位置,给予相应的环境的名称的名称。
作者(S)----------Author(s)----------
Kurt Hornik and Martin Maechler (May 1997).
参见----------See Also----------
glob2rx to convert wildcard patterns to regular expressions.
glob2rx正则表达式通配符模式转换。
objects for listing objects from one place, help.search for searching the help system, search for the search path.
objects上市对象从一个地方,help.search寻找帮助系统,search搜索路径。
举例----------Examples----------
require(stats)
## Not run: apropos("lm")[#无法运行:中肯(“LM”)]
apropos("GLM") # more than a dozen[十多]
## that may include internal objects starting '.__C__' if[#可能包括启动内部对象。__C__如果]
## methods is attached[#方法附]
apropos("GLM", ignore.case = FALSE) # not one[没有一个]
apropos("lq")
cor <- 1:pi
find("cor") #> ".GlobalEnv" "package:stats"[“GlobalEnv。”>“包:统计”]
find("cor", numeric=TRUE) # numbers with these names[这些名称的号码]
find("cor", numeric=TRUE, mode="function")# only the second one[只有第二个]
rm(cor)
## Not run: apropos(".", mode="list") # a long list[#无法运行:中肯(“。”模式“列表”)#一个长长的列表]
# need a DOUBLE backslash '\\' (in case you don't see it anymore)[需要双反斜线\ \(的情况下,你看不出来了)]
apropos("\\[")
## Not run: # everything [#不运行:#一切]
length(apropos("."))
# those starting with 'pr'[那些与“公关”开始]
apropos("^pr")
# the 1-letter things[1字母东西的]
apropos("^.$")
# the 1-2-letter things[1-2-信的东西]
apropos("^..?$")
# the 2-to-4 letter things[2至4信的东西]
apropos("^.{2,4}$")
# the 8-and-more letter things[信8和更多的东西]
apropos("^.{8,}$")
table(nchar(apropos("^.{8,}$")))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|