In bash I can trap SIGINT
, SIGKILL
, SIGTERM
, and so on. That allows me to do different things depending how the program was unexpectedly stopped.
Is there a way to do this in R?
Expanding a bit on my comment which OP asked me to post as an answer
The help file for conditions has the description
These functions provide a mechanism for handling unusual conditions, including errors and warnings.
There are many handling functions explained in the file, with examples. So I suggest starting with
help(conditions)
## and
example(conditions)
Additionally, tools::assertCondition
might be worth a look too. It is linked at the bottom of the conditions documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With