Getting the state of variables after an error occurs in R

后端 未结 3 772
谎友^
谎友^ 2020-12-02 21:21

Let\'s say I have just called a function, f, and an error occurred somewhere in the function. I just want to be able to check out the values of different varia

3条回答
  •  执念已碎
    2020-12-02 21:43

    options(error=recover)

    Probably answers the question best. However, I wanted to mention another handy debugging tool, traceback(). Calling this right after an error has occurred is often enough to pinpoint the bug.

提交回复
热议问题