I've included a library called blotter in my R script which has a bug in it. Is there an easy way for me to edit the source to try and debug the issue?
See Question&Answers more detail:osI've included a library called blotter in my R script which has a bug in it. Is there an easy way for me to edit the source to try and debug the issue?
See Question&Answers more detail:osLook up the trace
and browser
functions, they are the basic tools in R for debugging. Say you want to edit the source of function foo
, then saying
trace("foo",edit=TRUE)
will open up the source of foo in the editor for you to change. However, this is for interactive debugging; the source files in the packages are not changed. So once you have found the bug, you need to change the package source files for the change to be permanent.