Re: [R] Question about evalq

2007-05-28 Thread ronggui
Got it. Thanks very much. On 5/28/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: How about 'traceback'? (It does not necesssarily show all the frames, but it does help and the exceptions are fairly esoteric.) On Mon, 28 May 2007, ronggui wrote: In that the meaning of parent.frame depends

Re: [R] Question about evalq

2007-05-27 Thread Prof Brian Ripley
The meaning of parent.frame depends on where it is evaluated. So one should not expect it to do the same thing in two equivalent expressions (and nor should one expect deparse to do so, for example). A pretty close analogy is that using a symbolic link in a file system is equivalent to using

Re: [R] Question about evalq

2007-05-27 Thread ronggui
In that the meaning of parent.frame depends on where it is evaluated, is there a nice way to figure out which frame an express is evaluated? for example, I would like to konw what does parent.frame(2) refer to. f1 - function(x,digits=5) lapply(x, f2) f2 - function(x)

Re: [R] Question about evalq

2007-05-27 Thread ronggui
Hi,Gabor Grothendieck, Thanks very much. On 5/27/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: evalq looks like this: evalq function (expr, envir, enclos) eval.parent(substitute(eval(quote(expr), envir, enclos))) environment: namespace:base so it seems the difference is

Re: [R] Question about evalq

2007-05-27 Thread Gabor Grothendieck
On 5/27/07, ronggui [EMAIL PROTECTED] wrote: Hi,Gabor Grothendieck, Thanks very much. On 5/27/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: evalq looks like this: evalq function (expr, envir, enclos) eval.parent(substitute(eval(quote(expr), envir, enclos)))

Re: [R] Question about evalq

2007-05-27 Thread ronggui
That's great. I got it. Million thanks. On 5/28/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 5/27/07, ronggui [EMAIL PROTECTED] wrote: Hi,Gabor Grothendieck, Thanks very much. On 5/27/07, Gabor Grothendieck [EMAIL PROTECTED] wrote: evalq looks like this: evalq

Re: [R] Question about evalq

2007-05-27 Thread Prof Brian Ripley
How about 'traceback'? (It does not necesssarily show all the frames, but it does help and the exceptions are fairly esoteric.) On Mon, 28 May 2007, ronggui wrote: In that the meaning of parent.frame depends on where it is evaluated, is there a nice way to figure out which frame an express

[R] Question about evalq

2007-05-26 Thread ronggui
The help page of eval says: The 'evalq' form is equivalent to 'eval(quote(expr), ...)'. But the following is not equivalent. Can anyone give me some explaination? Thanks very much. f1 - function(x,digits=5) lapply(x, f2) f2 - function(x)

Re: [R] Question about evalq

2007-05-26 Thread Gabor Grothendieck
evalq looks like this: evalq function (expr, envir, enclos) eval.parent(substitute(eval(quote(expr), envir, enclos))) environment: namespace:base so it seems the difference is that - eval(quote(), envir, enclos) evaluates envir and enclos in the current frame but - evalq