showMethods(methods)
showMethods()所属R语言包:methods
Show all the methods for the specified function(s)
显示所有的方法,为指定的函数(S)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Show a summary of the methods for one or more generic functions, possibly restricted to those involving specified classes.
显示一个或多个通用功能可能仅限于那些涉及特定类别,方法的总结。
用法----------Usage----------
showMethods(f = character(), where = topenv(parent.frame()),
classes = NULL, includeDefs = FALSE,
inherited = !includeDefs,
showEmpty, printTo = stdout(), fdef)
参数----------Arguments----------
参数:f
one or more function names. If omitted, all functions will be shown that match the other arguments. The argument can also be an expression that evaluates to a single generic function, in which case argument fdef is ignored. Providing an expression for the function allows examination of hidden or anonymous functions; see the example for isDiagonal().
一个或多个函数名。如果省略,将会显示所有的功能相匹配的其他参数。该参数还可以是一个表达式,一个通用的功能,在这种情况下,忽略参数fdef。提供了一个表达的功能,允许隐藏或匿名函数检查;看到isDiagonal()的例子。
参数:where
Where to find the generic function, if not supplied as an argument. When f is missing, or length 0, this also determines which generic functions to examine. If where is supplied, only the generic functions returned by getGenerics(where) are eligible for printing. If where is also missing, all the cached generic functions are considered.
在哪里可以找到通用的功能,如果没有作为参数提供。当f丢失,或长度为0,这也决定了通用功能检查。如果where提供,仅通用函数返回getGenerics(where)印刷资格。如果where也不翼而飞,被视为所有缓存的通用功能。
参数:classes
If argument classes is supplied, it is a vector of class names that restricts the displayed results to those methods whose signatures include one or more of those classes.
如果参数classes提供,它是一个向量限制的结果显示这些方法的签名,包括一个或多个这些类的类名。
参数:includeDefs
If includeDefs is TRUE, include the definitions of the individual methods in the printout.
includeDefs如果是TRUE,包括在打印输出的单个方法的定义。
参数:inherited
logical indicating if methods that have been found by inheritance, so far in the session, will be included and marked as inherited. Note that an inherited method will not usually appear until it has been used in this session. See selectMethod if you want to know what method would be dispatched for particular classes of arguments.
逻辑表示如果通过继承已发现的方法,到目前为止,在会议,将包括标记为继承。注意:继承的方法通常不会出现,直到它已在本次会议。看到selectMethod如果你想知道什么方法将派出特定类别的参数。
参数:showEmpty
logical indicating whether methods with no defined methods matching the other criteria should be shown at all. By default, TRUE if and only if argument f is not missing.
逻辑表示方法与其他标准没有定义的匹配方法是否应显示在所有。默认情况下,TRUE当且仅当参数f不能缺少的。
参数:printTo
The connection on which the information will be shown; by default, on standard output.
上的信息将显示连接,默认情况下,在标准输出上。
参数:fdef
Optionally, the generic function definition to use; if missing, one is found, looking in where if that is specified. See also comment in "Details".
可选,通用的函数定义中使用,如果缺少,一个被发现,寻找where如果指定。也看到在“详细资料”发表评论。
Details
详情----------Details----------
The name and package of the generic are followed by the list of signatures for which methods are currently defined, according to the criteria determined by the various arguments. Note that the package refers to the source of the generic function. Individual methods for that generic can come from other packages as well.
其次,该方法是目前定义的签名列表的通用名称和包,根据各种参数确定的标准。请注意,包是指源的通用功能。个人泛型方法可以以及来自其他包。
When more than one generic function is involved, either as specified or because f was missing, the functions are found and showMethods is recalled for each, including the generic as the argument fdef. In complicated situations, this can avoid some anomalous results.
当涉及多个泛型函数,无论是作为指定或因为f失踪,功能是发现和showMethods回顾每个,包括泛型参数fdef。在复杂的情况下,这可避免一些异常的结果。
值----------Value----------
If printTo is FALSE, the character vector that would have been printed is returned; otherwise the value is the connection or filename, via invisible.
如果printToFALSE,将已印的特征向量,则返回,否则,该值是连接或文件名通过invisible,。
参考文献----------References----------
Software for Data Analysis: Programming with R Springer. (For the R version.)
Programming with Data Springer (For the original S4 version.)
参见----------See Also----------
setMethod, and GenericFunctions for other tools involving methods; selectMethod will show you the method dispatched for a particular function and signature of classes for the arguments.
setMethod,GenericFunctions涉及其他工具方法;selectMethod会告诉你一个特定的功能和参数类的签名派出的方法。
举例----------Examples----------
require(graphics)
## Assuming the methods for plot[#假设为图的方法]
## are set up as in the example of help(setMethod),[#中的例子帮助(setMethod)的成立,]
## print (without definitions) the methods that involve class "track":[#打印(无定义)涉及类的“跟踪”的方法:]
showMethods("plot", classes = "track")
## Not run: [#无法运行:]
# Function "plot":[功能的“图”:]
# x = ANY, y = track[x =任意,Y =轨道]
# x = track, y = missing[X =轨道,Y =失踪]
# x = track, y = ANY[X =轨道,Y =任何]
require("Matrix")
showMethods("%*%")# many![许多!]
methods(class = "Matrix")# nothing[没什么]
showMethods(class = "Matrix")# everything[一切]
showMethods(Matrix:::isDiagonal) # a non-exported generic[非出口的通用]
## End(Not run)[#结束(不运行)]
not.there <- !any("package:stats4" == search())
if(not.there) library(stats4)
showMethods(classes = "mle")
if(not.there) detach("package:stats4")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|