rstudio 的 traceback() 不再以交互方式工作

标签 r rstudio traceback

我刚开始在 rstudio 中进行调试。一开始一切都按照描述的方式工作 here .

enter image description here

我使用后 browser() ,我无法回到这个状态,也就是说没有互动区,我可以在那里按hide tracebackreturn with debug按钮。有谁知道,出了什么问题?

  • 以上建议无效。
  • traceback()有效,但该消息不再具有交互性。
  • options(error = function(){.rs.breakOnError(TRUE)})从这里 https://support.rstudio.com/hc/en-us/community/posts/202296047-error-recovery将该值设置为 TRUE,但仍然没有出现交互式回溯。

  • RStudio 版本

    platform x86_64-w64-mingw32
    arch x86_64
    os mingw32
    system x86_64, mingw32
    status
    major 3
    minor 2.2
    year 2015
    month 08
    day 14
    svn rev 69053
    language R
    version.string R version 3.2.2 (2015-08-14) nickname Fire Safety



    如果您还需要所有内容,请告诉我 options()设置。

    2018 年 11 月编辑 :运行一个有错误的脚本,交互式回溯处于事件状态。
    getOption("error")
    (function () 
    {
        .rs.recordTraceback(FALSE, 5, .rs.enqueueError)
    })()
    

    销毁交互式回溯(不知道,我做了什么):
    getOption("error")
    (function () 
    {
        .rs.recordTraceback(FALSE, 5, .rs.enqueueError)
    })()
    

    因此,设置是相同的,不清楚会发生什么......

    最佳答案

    我有同样的行为。以编程方式设置 error 后R 中的选项到 browser , tracebackrecover ,RStudio(调试/出错)中的按钮不再起作用。

    为了解决这个问题,我必须首先重置 error默认值的选项 NULL .之后,我可以取回交互式调试器。

    以下首先将选项重置为 NULL然后将选项设置为在 RStudio 中选择(调试/出错/错误检查器)时获得的行为。

    options(error = NULL)
    options(error = function(){.rs.recordTraceback(TRUE)})
    

    关于rstudio 的 traceback() 不再以交互方式工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36482607/

    相关文章:

    python - 如何将超过 3 个参数传递给 getattr?

    r - cor 仅显示 NA 或 1 的相关性 - 为什么?

    r - 创建下三角遗传距离矩阵

    r - 在 reticulate::use_condaenv(path) 之后无法弄清楚如何使用 conda 环境

    r - 当 DataExplorer::plot_str() 调用时,其他图消失

    exec 中字符串的 python 回溯?

    r - 无法使用 R markdown 和knitr 将在线图片合并到报告中

    r - 在 fread 中跳过并自动启动

    amazon-web-services - 如何设置 RStudio 服务器以在 AWS 上使用 SSL 运行?

    python - 如何在 Visual Studio Code 中将我的 python 文件导入到另一个文件中