I am new debugging in R using traceback()
and option(error=recover)
and debug(function)
to try to find the reason of an error I have in an R package.
I am debugging a function with a big loop and I want to 'step out' of the loop into the next block. How can I do that? I know that you can put breakpoints, but I don't know where the loop is nor which is the next step. I am in an only text environment so the graphical help of the debug package probably does not help.
To sum up, how to step out of a loop when debugging, and how to step into a function for debug when you are already debugging?
Probably this has been already answered and I have missed it. I have seen several SO R debug question but none answering this part that I am aware.
You can add a breakpoint after the loop and click F8 (resume). The debugger will stop on the next found breakpoint, e.g. you will have skipped the loop(s).
You can also click on the line you want to skip to and hit Ctrl+F10 (Run to Cursor). It will jump directly to that line.
I'm fairly sure R's help system works even if you're not using a GUI. Try typing ?debug
and see what happens. You ought to be informed that typing c
or cont
will
continue to the end of the current context: e.g. to the end of the loop if within a loop or to the end of the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With