R语言学习笔记:查看函数的R源代码
2013-11-11 22:13
417 查看
[b]getAnywhere[/b]
该函数可以返回一些函数的R源代码,如:
getAnywhere(kmeans)
该函数具体用法,请参看官方说明。
They do not search literally “anywhere”: for example, local evaluation frames and namespaces that are not loaded will not be searched.
Where functions are found as registered S3 methods, an attempt is made to find which namespace registered them. This may not be correct, especially if namespaces have been unloaded.
In computing whether objects are identical, their environments are ignored.
Normally the structure will be hidden by the
For
该函数可以返回一些函数的R源代码,如:
getAnywhere(kmeans)
该函数具体用法,请参看官方说明。
Retrieve an R Object, Including from a Namespace
Description
These functions locate all objects with name matching their argument, whether visible on the search path, registered as an S3 method or in a namespace but not exported.getAnywhere()returns the objects and
argsAnywhere()returns the arguments of any objects that are functions.
Usage
getAnywhere(x) argsAnywhere(x)
Arguments
x | a character string or name. |
Details
These functions look at all loaded namespaces, whether or not they are associated with a package on the search list.They do not search literally “anywhere”: for example, local evaluation frames and namespaces that are not loaded will not be searched.
Where functions are found as registered S3 methods, an attempt is made to find which namespace registered them. This may not be correct, especially if namespaces have been unloaded.
Value
ForgetAnywhere()an object of class
"getAnywhere". This is a list with components
name | the name searched for |
objs | a list of objects found |
where | a character vector explaining where the object(s) were found |
visible | logical: is the object visible |
dups | logical: is the object identical to one earlier in the list. |
Normally the structure will be hidden by the
[method to extract one or more of the objects found.
For
argsAnywhere()one or more argument lists as returned by
args.
See Also
getS3methodto find the method which would be used: this might not be the one of those returned by
getAnywheresince it might have come from a namespace which was unloaded or be registered under another name.
get,
getFromNamespace,
args
Examples
getAnywhere("format.dist") getAnywhere("simpleLoess") # not exported from stats argsAnywhere(format.dist)
相关文章推荐
- jQuery源代码学习笔记_工具函数_noop/error/now/trim
- R语言与函数估计学习笔记(函数模型的参数估计)
- MFC学习笔记:怎样尽可能的跟踪和查看MFC中函数的代码
- 韩顺平_轻松搞定网页设计(html+css+javascript)_第33讲_Object类_闭包_成员函数再说明_聪明的猪小练习_学习笔记_源代码图解_PPT文档整理
- R语言学习笔记之apply、lapply、sapply、mapply、tapply函数详解
- R语言函数与模型学习笔记:残差相关性零均值检验及跨期相关系数(图)
- R语言与函数估计学习笔记(函数展开)
- R语言学习笔记 —— table 函数的应用
- R语言学习笔记2——常用数学函数
- R语言layout函数学习笔记
- R语言-函数源代码查看
- R语言学习笔记之transform函数
- R语言学习笔记之lm函数
- 韩顺平_轻松搞定网页设计(html+css+javascript)_第26讲_js函数调用过程内存分析_js函数细节_学习笔记_源代码图解_PPT文档整理
- R语言与函数估计学习笔记(核方法与局部多项式)
- R语言学习笔记--数据框输出和查看
- R语言与函数估计学习笔记(样条方法)
- 韩顺平_轻松搞定网页设计(html+css+javascript)_第32讲_构造函数_成员函数详解_学习笔记_源代码图解_PPT文档整理
- C语言学习笔记.指针3--指针变量作为函数参数
- PL/SQL函数学习笔记:lpad函数