[R] Suppressing certain debugging output

Stuart Andrews
Mon, 21 Dec 2009 17:13:58 -0000

keywords: debug, do.call, "debugging in", suppress, arguments, list,
screen, console, output

Hi,

I would like to control the output to the console while debugging
functions that are called by do.call( FCN, ARGUMENTS )  when the
arguments are quite large.  Is there a simple way to suppress (or
compress) this output?

Thanks,
- Stu


For example:

ttt = function(x) { length(x) };  debug(ttt);  do.call(ttt,
list(x=rep(0,10)))
ttt = function(x) { length(x) };  debug(ttt);  do.call(ttt,
list(x=rep(0,100)))
ttt = function(x) { length(x) };  debug(ttt);  do.call(ttt,
list(x=rep(0,10000000)))


The first line prints the following to the console ...

debugging in: function(x) { length(x) }
(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
debug: {
     length(x)
}
Browse[1]>


The second prints ...

debugging in: function(x) { length(x) }
(x = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
debug: {
     length(x)
}
Browse[1]>


Etc.
Etc.