I have a program that does some data analysis and is a few hundred lines long.
Very early on in the program, I want to do some quality control and if there is not enou
Here:
if(n < 500) { # quit() # or # stop("this is some message") } else { *insert rest of program here* }
Both quit() and stop(message) will quit your script. If you are sourcing your script from the R command prompt, then quit() will exit from R as well.
quit()
stop(message)