Can I trap signals in R?

后端 未结 1 1822
Happy的楠姐
Happy的楠姐 2021-01-06 07:01

In bash I can trap SIGINT, SIGKILL, SIGTERM, and so on. That allows me to do different things depending how the program was unexpected

1条回答
  •  不要未来只要你来
    2021-01-06 07:19

    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.

    0 讨论(0)
提交回复
热议问题