R's equivalent of Python's sys.exit(exit_code) ?

Given that exit_code is some integer value, what would be R's equivalent of Python's sys.exit(exit_code)?

Does the stop() or stopifnot() function do what you need?

This should answer this question:

https://stackoverflow.com/a/7681213/11117265