You can set any function for debugging with debug
.
debug(mean)
mean(1:3)
All subsequent calls to the function will enter debugging mode. You can disable this behavior with undebug
.
undebug(mean)
mean(1:3)
If you know you only want to enter the debugging mode of a function once, consider the use of debugonce
.
debugonce(mean)
mean(1:3)
mean(1:3)