【发布时间】:2015-09-24 02:51:48
【问题描述】:
我正在使用的包中的一个函数给了我信息量不大的错误。我不知道发生了什么事。这个函数是由我调用的函数在内部调用的。像这样的:
myres <- the.func(x)
the.func <-function(x){
unexported.func(x)
}
如何调试 unexported.func ?
使用debug 不起作用:
>debug(unexported.func)
Error in debug(undexported.func) : object 'unexported.func' not found
更新: 目前我做嵌套调试如下。但我觉得不方便:
>debug(the.func) # Initiate debugging for the outer function, so I get unexported.func loaded.
>myres <- the.func(x)
Browse[2]>debug(unexported.func) # Now I can call debug with this.
【问题讨论】:
-
是一个可以附加断点的调试器吗?
-
这是一个很好的观点。
ESS提供了一种设置断点的方法。但我不知道如何导航到包含unexported.func实现的类并在那里设置断点。 -
这不是 Emacs 或 ESS 特有的;它实际上是在 R 级别引用未导出的函数,这就是
:::的用途。
标签: r debugging namespaces