Skip to content

debugging S4 methods

2 messages · Sebastian Mueller, Duncan Murdoch

#
Hi all,

Does anyone know how to debug S4 methods? In my case I want to find an
error in the specc-function of the kernlab-package.
As this seems to be a S4-method the normal S3 debugging can't be
applied apparently (e.g. debug(s3function.someclass)).

So in my case
seems only to debug the generic-function:
function (x, ...)
standardGeneric("specc")
<environment: 0x9088080>

which doesn't help me. Does anyone know how to debug the real-code?

Thanks for your help!
Sebastian
#
On 01/10/2009 7:02 AM, sebastian mueller wrote:
You can insert a call to browser() if you want to modify the source.  If 
you'd rather not do that, you can use trace() to set a breakpoint in it.
The new setBreakpoint() function in R 2.10.0 will also work, if you 
install the package from source with the R_KEEP_PKG_SOURCE=yes 
environment variable set.  It allows you to set a breakpoint at a 
particular line number in the source code.

Duncan Murdoch