Skip to content
Prev 6948 / 15075 Next

How to interrupt an R process that hangs

Hi all,

Thanks Simon and Duncan for the help. Sorry to be dense, but I'm still
unsure how to interrupt such processes. Here's an example:

for (i in 1:100000){
	a <- matrix(rnorm(100000*100000),ncol=100000)
	b <- svd(a)	}

If you run this, R will hang (i.e., it's a legitimate execution, it
will just take a really long time to execute). The most obvious
solution is to write code that doesn't do unintended things, but
that's not always possible. Is there a way to interrupt it? I tried:

kill -s INT <PID>

and at least on Mac it had no effect. Thanks again,

Matt



On Mon, Mar 15, 2010 at 1:19 PM, Simon Urbanek
<simon.urbanek at r-project.org> wrote: