调试R中未由包导出的函数 [英] debugging a function in R that was not exported by a package

查看:123
本文介绍了调试R中未由包导出的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用 debug() trace(),一个不是出口例如,我可以如何从 vcov.polr 中的 MASS code> polr 。 polr 被导出,但是vcov.polr不是。

I would like to step through, using debug() or trace(), a function that was not exported. For example, how can I do it for vcov.polr of the package MASS, which is called from the function polr. polr is exported, but vcov.polr is not.

那就是当我运行 polr ,我希望调试浏览器开始一旦代码进入 vcov.polr

That is, when I run polr, I would like the debug browser to start once the code enters vcov.polr.

推荐答案

尝试

debug(MASS:::vcov.polr)

注意三个冒号 ::: 隐藏对象在包中可见。

note that three colon ::: make the hidden object in a package visible.

这篇关于调试R中未由包导出的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆