有没有办法只列出在类定义中明确定义的引用类的那些方法(与“系统类”继承的那些方法相反,例如refObjectGenerator
or envRefClass
)?
Example <- setRefClass(
Class="Example",
fields=list(
),
methods=list(
testMethodA=function() {
"Test method A"
},
testMethodB=function() {
"Test method B"
}
)
)
您当前通过调用该$methods()
方法获得的结果(请参阅 参考资料?setRefClass
):
> Example$methods()
[1] "callSuper" "copy" "export" "field" "getClass"
[6] "getRefClass" "import" "initFields" "show" "testMethodA"
[11] "testMethodB" "trace" "untrace" "usingMethods"
我在找什么:
> Example$methods()
[1] "testMethodA" "testMethodB"