I am developing a package in RStudio and would like to use breakpoints to debug my functions. However, I keep running into the same problem: I set a breakpoint, RStudio warns me that the package has to be built and reloaded to activate the breakpoint (even if I just built and reloaded the package), and then when I build and reload the package the breakpoint disappears. Is there something I am not understanding?
The most common (and easiest) way to stop on a line of code is to set a breakpoint on that line. You can do this in RStudio by clicking to the left of the line number in the editor, or by pressing Shift+F9 with your cursor on the desired line. We call this an “editor breakpoint”.
Options in RStudio In addition to debug() and browser(), you can also enter debug mode by setting “editor breakpoints” in RStudio by clicking to the left of the line in RStudio, or by selecting the line and typing shift+F9.
Breakpoints are most commonly used to interrupt a running program immediately before the execution of a programmer-specified instruction. This is often referred to as an instruction breakpoint.
move your .R
file to the directory that .RData
exist and then
setwd("directory of .RData file")
.
this solution worked for me!
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