Make R exit with non-zero status code

I am looking for the R equivalent of linux / POSIX (n) output, which will stop the process with exit code n, signaling to the parent process that an error has occurred. Does R have such an object?

+47
r exit
Oct 06 2018-11-11T00:
source share
1 answer

This is the quit() argument. See ?quit .

Arguments:

 status: the (numerical) error status to be returned to the operating system, where relevant. Conventionally '0' indicates successful completion. 

More details:

  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. 
+47
Oct. 06 2018-11-11T00:
source share



All Articles