Make R exit with non-zero status code
问题 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? 回答1: It's an argument to quit() . See ?quit . Arguments : status: the (numerical) error status to be returned to the operating system, where relevant. Conventionally ‘0’ indicates successful completion. Details : Some error statuses are used by R itself. The default error handler for non-interactive use