4 ms·
I find I spend most of my time debugging R, which is astoundingly difficult since it doesn’t report line numbers on errors. Most of my code is in C++, so that h
by sargram01 7y ago
I find I spend most of my time debugging R, which is astoundingly difficult since it doesn’t report line numbers on errors. Most of my code is in C++, so that helps, albeit it’s still overly complicated to start up R in gdb. Amazingly Julia isn’t much better when it comes to error reporting either.
- kgwgk 7y ago# cat /tmp/test.R x <- 1:10 y <- 1:20 plot(x, y) # R --quiet > source("/tmp/test.R") Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ > traceback() 8: stop("'x' and 'y' lengths differ") 7: xy.coords(x, y, xlabel, ylabel, log) 6: plot.default(x, y) 5: plot(x, y) at test.R#3 4: eval(ei, envir) 3: eval(ei, envir) 2: withVisible(eval(ei, envir)) 1: source("/tmp/test.R") If you mean the lines in the packages you used, I think you'll see the lines if you build them with keep.source=TRUE
- CreRecombinase 7y agoIt's so crazy easy to start R in gdb: R -d gdb that's it!
- ksevastyanenko 7y agoYou might find this package useful https://github.com/robertzk/bettertrace https://github.com/robertzk/bettertrace
- Zelazny7 7y agooptions(error=recover)
- LegitShady 7y agoAll the design brief said was get started anything beyond that is a change request