[R] do.call() browser() hang with large data.frame

Alistair Gee alistair.gee at gmail.com
Wed Feb 13 22:04:46 CET 2008


I have a problem similar to this:

http://tolstoy.newcastle.edu.au/R/help/06/02/21987.html

If I try to debug (via browser()) and the call stack has a do.call()
call with a large data frame, R hangs for a very long time. If,
instead, replaced the do.call() call with a direct call, there is no
hang.

What can I do?

I am using R 2.6.2.patched built from SVN today on Linux AMD64.

Here is my sample code:

#########################################################

options(deparse.max.lines=10)

### Create a big data frame with 1 million rows and 100 columns. This
do.call() is NOT the problem.
a <- do.call(data.frame,
             sapply(sprintf("col%d", 1:100), function(x) rnorm(1e6),
                    simplify=FALSE, USE.NAMES=TRUE))

### function I want to debug via browser()
foo <- function(aa, bb) {
  browser()  # I want to stop here to debug.
}

### This goes into the browser() immediately:
foo(aa=a,bb=2)

### This hangs for a very long time:
do.call(foo, list(aa=a, bb=2))



More information about the R-help mailing list