From: Charilaos Skiadas <cskiadas_at_gmail.com>

Date: Sat, 22 Dec 2007 15:30:34 -0500

R-help_at_r-project.org 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 Sat 22 Dec 2007 - 20:34:42 GMT

Date: Sat, 22 Dec 2007 15:30:34 -0500

After many hours of debugging code, I came to the conclusion that I
have a fundamental misunderstanding regarding eval, and hope that
someone here can explain to me, why the following code acts as it does:

eval(substitute(expr), envir=list(a=5), enclos=parent.frame())
}

bar <- function(er) {

> foo(a)

[1] 5

> bar(a)

Error in eval(expr, envir, enclos) : object "a" not found

Anyway, hope someone will correct me where I'm wrong, and explain to me what I am doing wrong, and ideally how to diagnose such things.

Thanks,

Haris Skiadas

Department of Mathematics and Computer Science
Hanover College

R-help_at_r-project.org 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 Sat 22 Dec 2007 - 20:34:42 GMT

Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.

Archive generated by hypermail 2.2.0, at Sun 23 Dec 2007 - 03:30:21 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.
*