I've seen this question which answers how to exit a function when needed. But I'm working with a complex R script which I'm debugging. I run it in VScode, and would be nice if there was a command to simply stop running the script altogether, as using exit(1)
in python. See the code below for example.
rm(list=ls()) # Ensuring workspace starts off clean
a <- 1 # Do stuff I'm confident about
b <- 2 # Stuff I need to check if worked
cat(b)
Function_to_Stop_Execution_Here() # What can I for about this?
Stuff_I_dont_want_to_run()