Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to skip a command or line of code during a debugging session

Tags:

r

debugging

while debugging in the R language, is it possible to bypass the stop() and make it to the code that i want to step through?

myfun <-
    function(){
        browser()
        stop("any way around this?")

        print("code that i want to step through")

        TRUE
    }

myfun()
like image 969
Anthony Damico Avatar asked Oct 19 '25 04:10

Anthony Damico


1 Answers

You can mask stop:

> myfun()
Called from: myfun()
Browse[1]> stop <- message
Browse[1]> n
debug at #4: stop("any way around this?")
Browse[2]> n
any way around this?
debug at #6: print("code that i want to step through")
Browse[2]> stop <- base::stop
Browse[2]> n
[1] "code that i want to step through"
debug at #8: [1] TRUE
Browse[2]> n
[1] TRUE
like image 97
Roland Avatar answered Oct 21 '25 18:10

Roland



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!