[R-SIG-Finance] qsiblive, how to debug code with source() as sub procedure

unsown unsown at gmail.com
Sat Jul 14 16:59:39 CEST 2012


I'm not an experienced R user and I'm currently trying with the psiblive demo
codes. I found the source() command has been used in quite a few places  in
the codes. I understand that by using this a long procedure can be separated
into several modules, but  I found it is not easy to debug. One of the
difficulty is that it seems not easy to find out which file and which line
the error belonged to. I tried commands such as debug, browser, trace and
recover, but often ended up with nowhere. It takes me a lot time to locate
where the problem is. So I wondered if there is any standard way or
procedure to debug code with many files sourced into it?

And as far as I know the R will interpret the sourced codes by aggregating
them into a single procedure. I wondered if it would be safer and clearer to
just use functions for the same purpose of source()?

--
View this message in context: http://r.789695.n4.nabble.com/qsiblive-how-to-debug-code-with-source-as-sub-procedure-tp4636519.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list