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

From: Alistair Gee <alistair.gee_at_gmail.com>
Date: Wed, 13 Feb 2008 13:04:46 -0800


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))



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 13 Feb 2008 - 21:09:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 13 Feb 2008 - 23:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive