R avoiding “restarting interrupted promise evaluation” warning

后端 未结 1 680
攒了一身酷
攒了一身酷 2021-01-03 18:13

Problem

It seems that within a function, when you evaluate an expression that yields an error more than once, you get the warning restarting interrupted prom

相关标签:
1条回答
  • 2021-01-03 18:48

    You can also try this without silent=TRUE if you want each error message to show. In neither case will you get the message about promises:

    foo <- function() stop("Foo error")
    bar <- function(x) {
        try(eval.parent(substitute(x)), silent = TRUE)
        x
    }
    bar(foo())
    
    0 讨论(0)
提交回复
热议问题