q(save = "default", status = 0, runLast = TRUE) quit(save = "default", status = 0, runLast = TRUE)
save | character string. One of "yes", "no", "ask" or "default". The default is "default". |
status | integer value. The exit code. |
runLast | logical flag. If TRUE and a .Last function has been defined, it is run. The default is TRUE. |
## Not run: q() # quit session normally - typically asks user to save workspaceq(save="no") # quit session without saving workspace
# on Linux, view return status after process exits: # # 0
q(save="yes", status=123) # quit session with status code and saving workspace
# on Linux, view return status after process exits # # 123
options(error=quote(q("no", status=1))) # The next error will quit the session ## End(Not run)