|
http://web.mit.edu/r/current/lib/R/library/base/html/options.html
error
:
either a function or an expression governing
the handling of non-catastrophic errors such as those generated bystop
as well as by signals and internally detected
errors. If the option is a function, a call to that function,
with no arguments, is generated as the expression. The default
value is NULL
: see stop
for the behaviour in
that case. The functions dump.frames
andrecover
provide alternatives that allow post-mortem
debugging. Note that these need to specified as
e.g. options(error = utils::recover)
in startup
files such as ‘.Rprofile’.
# 需要跳过错误,继续运行下面的代码。可以设置option(error=...)
# Will continue to execute script even after error, when options()$error is not NULL
options(error = function(){cat('continue to execute script even after error.\n')})
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-27 09:26
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社