Re: [R] do.call, browser and traceback

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri 24 Feb 2006 - 06:04:07 EST

On Mon, 20 Feb 2006, hadley wickham wrote:

> A problem that I've encountered when using do.call a lot is very large
> stack traces, eg:
>
> f <- function(x) stop()
> do.call(error, mtcars)
> traceback()
> f <- function(x) browser()
> do.call(f, mtcars)

Did you mean that? Both are errors. Perhaps

f <- function(...) browser()
do.call(f, mtcars)

is an actual example of the idea.

What is being used is

 	Rprintf("Called from: ");
 	PrintValueRec(cptr->call,rho);

in src/main/main.c. We could certainly allow an option to limit the deparse length, but I have to say that quite often the useful information is well down the list of arguments. There is currently no user control.

>
> I have hacked together my own version of traceback to fix this by
> limiting the length of each line to 80 characters, but I can't see any
> way to do something similar for browser. Any suggestions?
>
> Thanks,
>
> Hadley
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri Feb 24 07:13:20 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:44 EST