Look at ?mtrace for a start...
And probably you need to look at the function go()
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Fred J.
Sent: Thursday, March 25, 2004 8:16 PM
To: r help
Subject: [R] mlocal/mtrace inside a loop
Hello
I need some help in figuring Bravington's debugger
out.
Ok
I have 2 functions, fun1 and fun2 saved in a ASCII
file say filename is funs.
Fun1 has a loop which calls fun2, fun2 has a loop
which fails and I need to find out the value of the
variables of the fun2 and fun1 loops at the specific
iteration that fails. Both fun1 and fun2 loops will
iterate thousands of times so line by line debug is
not practical.
According to what I understood from > ?mlocal and the
Vol. 3/3, December 2003 R-news article "Debugging
Without (Too Many) Tears" by Mark Bravington. P.32
first column last paragraph, I did. "Which needs some
fixing and direction - thanks"
> source("funs")
> library(debug)
> debug(fun1)
data <- fun1(some.arguments")
in the file funs
Was ...
fun1 <- function(arg1){ some looping code with calls
to fun2 }
fun2 <- function(arg2) {some more looping code}
Is now...to confirm to what I read
Fun1 <- function(arg1, nlocal=sys.parent())
mlocal(some more looping code)
I think I am implementing this package wrong and need
some help.
Thanks
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html