R not responding request to interrupt stop process

前端 未结 2 469
予麋鹿
予麋鹿 2021-01-17 07:29

Every now and then I have to run a function that takes a lot of time and I need to interrupt the processing before it\'s complete. To do so, I click on the red sign of "

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-17 08:11

    Unfortunately, RStudio is currently not able to interrupt R in a couple situations:

    1. R is executing an external program (e.g. you cannot interrupt system("sleep 10")),

    2. R is executing (for example) a C / C++ library call that doesn't provide R an opportunity to check for interrupts.

    In such a case, the only option is to forcefully kill the R process -- hopefully this is something that could change in a future iteration of RStudio.


    EDIT: RStudio v1.2 should now better handle interrupts in many of these contexts.

提交回复
热议问题