Re: [R] Problem accessing sub-methods of functions stored in a vector

2010-02-26 Thread Gabor Grothendieck
On Fri, Feb 26, 2010 at 11:57 AM, Matt Asher wrote: > Hi, > > This: > > agents <- list(agent(1), agent(2)) > > worked perfectly. Thanks Uwe! > > I'm not fully sure what you mean by this: > > " > Anyway, I hope you know that lexical scoping will yield in the > environments attached to all those fun

Re: [R] Problem accessing sub-methods of functions stored in a vector

2010-02-26 Thread Matt Asher
Hi, This: agents <- list(agent(1), agent(2)) worked perfectly. Thanks Uwe! I'm not fully sure what you mean by this: " Anyway, I hope you know that lexical scoping will yield in the environments attached to all those functions they have been generated in and you know about possible consequenc

Re: [R] Problem accessing sub-methods of functions stored in a vector

2010-02-26 Thread Uwe Ligges
On 26.02.2010 16:33, Matt Asher wrote: Hi folks, I am having trouble accessing sub-functions when the main function is stored in an array. For example, the following test code works fine: fcns = c(abs, sqrt) fcns[[1]](-2) fcns[[2]](2) However, when I try to access sub-functions declared with