R相当于MATLAB的“如果错误停止” [英] R equivalent to MATLAB's "stop if error"
本文介绍了R相当于MATLAB的“如果错误停止”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试调试一个R程序,如果错误 matlab的能力,我非常缺少停止。我已经浏览了 R-debug-tools.pdf 文档,但它没有列出这样的东西。有没有办法指示R,当遇到任何错误 - 甚至一个我没有预期并计划使用自定义
跟踪
函数 - 它应该停止执行并将我扔进 browser()
模式?
I'm attempting to debug an R program, and I'm sorely missing the stop if error
capability of matlab. I've gone through the R-debug-tools.pdf documentation, but it didn't list anything like this. Is there any way to instruct R that, when any error at all is encountered - even one I didn't anticipate and plan for with a custom trace
function - it should stop execution and throw me into browser()
mode?
推荐答案
我相信你想要 options(error = recover)
这篇关于R相当于MATLAB的“如果错误停止”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文