Re: [R] Assigning variables into an environment.

2009-12-10 Thread Rolf Turner
Thanks to Gabor Grothendieck, Duncan Murdoch, Hadley Wickham, and Bert Gunter for their useful input. I'm beginning to get a glimmering of understanding, and I think I now have enough to make some progress. cheers, Rolf Turner #

Re: [R] Assigning variables into an environment.

2009-12-10 Thread Bert Gunter
e- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Duncan Murdoch Sent: Thursday, December 10, 2009 2:27 AM To: hadley wickham Cc: R-help Forum Subject: Re: [R] Assigning variables into an environment. On 09/12/2009 11:29 PM, hadley wickham wrote: > On We

Re: [R] Assigning variables into an environment.

2009-12-10 Thread Duncan Murdoch
On 09/12/2009 11:29 PM, hadley wickham wrote: On Wed, Dec 9, 2009 at 9:43 PM, Rolf Turner wrote: I am working with a somewhat complicated structure in which I need to deal with a function that takes ``basic'' arguments and also depends on a number of parameters which change depending on circums

Re: [R] Assigning variables into an environment.

2009-12-09 Thread hadley wickham
On Wed, Dec 9, 2009 at 9:43 PM, Rolf Turner wrote: > > I am working with a somewhat complicated structure in which > I need to deal with a function that takes ``basic'' arguments > and also depends on a number of parameters which change depending > on circumstances. > > I thought that a sexy way o

Re: [R] Assigning variables into an environment.

2009-12-09 Thread Gabor Grothendieck
R uses lexical scoping, not dynamic scoping. It does not matter where bar is called from. What matters is where bar was defined and since bar was defined in the global environment that is where its free variables are looked up thus environment(bar) is the global environment. Try changing foo to t

[R] Assigning variables into an environment.

2009-12-09 Thread Rolf Turner
I am working with a somewhat complicated structure in which I need to deal with a function that takes ``basic'' arguments and also depends on a number of parameters which change depending on circumstances. I thought that a sexy way of dealing with this would be to assign the parameters as object