[R] no line number from error

Ross Boylan ross at biostat.ucsf.edu
Fri Apr 25 00:40:59 CEST 2014

 > r1 <- totalEffect.all(dsim, simjob)
 Error: attempt to apply non-function
 > traceback()
 1: totalEffect.all(dsim, simjob)
 > class(totalEffect.all)
 [1] "function"
How can I find out where in totalEffect.all the error is arising?
My only theory for the lack of line number was that totaEffect.all was
not a function; it is.  Further, previous calls to the function worked,
and errors in it produced line numbers.  After fixing a previous error
I'm now getting this.

All my code is sourced from files except for the driver.  The driver
code is in the same file that defines totalEffect.all.

In this particular case I stepped through with the debugger and found
that in the  line
accums[[m]]$delta$accum(up - down, data)

the delta object was NULL and so accum is not a function on it.  But I
hope there's a better way to locate an error.

R 3.0.3

More information about the R-help mailing list