[R] how to debug (mtrace) a function defined inside a function?

Andre Zege azege at yahoo.com
Fri Oct 29 23:19:20 CEST 2010


Hi, everyone. I am using a fair amount of closures in my code. Problem i am
experiencing is i cannot figure out how to mtrace functions defined within a
function. There must be some way to name such function for mtrace to see it
and let me step into it. For example, say i have code


mymodel<-function(){
 data<-numeric(0)
 build<-function(){
   data<<-1
 }
 
 m<-list()
 m$build<-build
 m
}


How do I mtrace build function defined inside mymodel function so that i can
step into build?
-- 
View this message in context: http://r.789695.n4.nabble.com/how-to-debug-mtrace-a-function-defined-inside-a-function-tp3019781p3019781.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list