user629019 user629019 - 1 year ago 57
R Question

R: How do I set a breakpoint in a different file?

I have two files:



Main.R has the line


Main.R calls a function in Called.R. I can step into the function in called.R, from Main.R no problem.

However, if I set a breakpoint in the function in Called.R and call that function from Main.R, execution does not stop at the breakpoint. However, if I move the function into Main.R, execution does stop.

Any idea if RStudio's debugger can recognize breakpoints set in 'sourced' files? I can't even find the problem referred to in the documentation.


Answer Source

add a temporary browser() line inside of that function