34 R: Debug Function in a Base R or Packages
Debugging functions from Base R or other packages depend on the complexities of those functions, and how the functions call other functions.
34.1 Option 1: Use debug
34.2 Option 2: Use trace
34.3 Option 3: Use trace
with edit arguments
If the function is a stand-alone funciton, you may create a copy of the function, rename the function and almost evaluate it as your own function.