Re: [R] need help with debug package

From: Tong Wang <wangtong_at_usc.edu>
Date: Thu 04 Jan 2007 - 09:04:48 GMT

I think I have figured out part of the answer, when I entered a debugger, the calling environment (parent frame) refers to the debugger program, instead of the mainfun( ). But is there anyway to solve this problem ?

thanks

> Hi all,
> I met a problem while using the debug package, I have the
> following program:
>
> mainfun<- function(){
> beta<-1
> result<-subfun(beta+x)
> }
>
> subfun<-function(expr){
> y <- eval(expr, envir=list(x=c(1,2)),enclos =
> parent.frame()) return(y)
> }
>
> I have no problem using this program without calling the debug
> package. but once
> I mtrace(subfun), the debugger can't find all the beta after
> entering subfun , and give
> the message : "Error in beta : non-numeric argument to binary
> operator"
> Is there anyway to get around ?
>
> thanks a lot
> happy new year
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Jan 04 20:12:34 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 04 Jan 2007 - 11:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.