使用非零状态码使R退出 [英] Make R exit with non-zero status code
本文介绍了使用非零状态码使R退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找linux/POSIX exit(n)的R等效项,它将以退出代码n停止进程,并向父进程发出已发生错误的信号. R有这样的便利吗?
I am looking for the R equivalent of linux/POSIX exit(n) which will halt the process with exit code n, signaling to a parent process that an error had occurred. Does R have such a facility?
推荐答案
它是quit()
的参数.参见?quit
.
参数:
status: the (numerical) error status to be returned to the operating
system, where relevant. Conventionally ‘0’ indicates
successful completion.
详细信息:
Some error statuses are used by R itself. The default error
handler for non-interactive use effectively calls ‘q("no", 1,
FALSE)’ and returns error code 1. Error status 2 is used for R
‘suicide’, that is a catastrophic failure, and other small numbers
are used by specific ports for initialization failures. It is
recommended that users choose statuses of 10 or more.
这篇关于使用非零状态码使R退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文