【发布时间】:2021-11-01 15:02:36
【问题描述】:
有没有办法让tryCatch 的warning 参数传递expr 的结果,即使有已处理的警告?
r <- tryCatch(
{
warning("I'm a warning!")
return(100) # I want the return value of the tryCatch to be this!
},
warning = function(w) {
# send a notification with the warning message
}
)
r 的结果应该是 100!
【问题讨论】:
标签: r