R 不响应中断停止进程的请求 [英] R not responding request to interrupt stop process

查看:74
本文介绍了R 不响应中断停止进程的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须时不时地运行一个需要大量时间的函数,我需要在它完成之前中断处理.为此,我点击了停止"的红色标志.在 Rstudio 的控制台顶部,它经常返回以下消息:

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 "stop" at the top of the console in Rstudio, which quite often returns this message below:

R 未响应您的中断处理请求,因此要停止当前操作,您可能需要完全终止 R.

R is not responding to your request to interrupt processing so to stop the current operation you may need to terminate R entirely.

终止 R 将导致您的 R 会话立即中止.活动计算将被中断,未保存的源文件更改和工作区对象将被丢弃.

Terminating R will cause your R session to immediately abort. Active computations will be interrupted and unsaved source file changes and workspace objects will be discarded.

现在要终止 R 吗?

问题是我点击了否"然后 Rstudio 似乎完全冻结了.我想知道其他人是否面临类似的问题,以及是否有任何方法可以解决此问题.

The problem is that I click "No" and then Rstudios seems to freeze completely. I would like to know if others face a similar issue and if there is any way to get around this.

有没有办法在不丢失工作区中的对象的情况下快速停止 Rstudio 中的进程?

推荐答案

不幸的是,RStudio 目前无法在以下几种情况下中断 R:

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

  1. R 正在执行外部程序(例如,您不能中断 system("sleep 10")),

R 正在执行(例如)一个 C/C++ 库调用,它没有为 R 提供检查中断的机会.

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

在这种情况下,唯一的选择是强制终止 R 进程——希望这可以在 RStudio 的未来迭代中改变.

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.

RStudio v1.2 现在应该可以更好地处理这些上下文中的许多中断.

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

这篇关于R 不响应中断停止进程的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆