On 10/10/2009 7:00 PM, Another Oneforyou wrote:
Hi,
I'm working through "R-debug-tools.pdf" and on page 7 it describes doing:
Browse[1]> debug(sum) ## Flag sum for debugging
however, when I try this, I get:
Browse[1]> debug(sum)Error in debug(fun) : argument must be a closure
Does anyone know why I get this error, and how to work around it?

debug() only works on regular functions (which are called "closures"). sum() is a special built in function, because it is so frequently used, and because it needs to be fast. So you can't debug it.

Whoever wrote those instructions should update them to use a different example. (Google suggests that the document was written in 2002, so someone may very well have already done so.)

Duncan

______________________________________________
R-help@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.

Reply via email to