RE: [R] R and pointer

2003-08-29 Thread Simon Fear
foo <- function(y) assign(deparse(substitute(y)), y^2, parent.frame()) assigns to the calling frame. Or you could put the required frame as a second argument. > -Original Message- > From: Barry Rowlingson [mailto:[EMAIL PROTECTED] > Cutting to what I think was the gist of the original pos

Re: [R] R and pointer

2003-08-29 Thread Barry Rowlingson
Henrik Bengtsson wrote: All of the above are written in the light object-oriented programming, but from [1] you quite easily get what is needed for just emulating "pointers". Be careful though as R is a functional language. Cutting to what I think was the gist of the original poster's question,

RE: [R] R and pointer

2003-08-29 Thread Henrik Bengtsson
ECTED] On Behalf Of Jeff Gentry > Sent: den 29 augusti 2003 14:34 > To: Laetitia Marisa > Cc: [EMAIL PROTECTED] > Subject: Re: [R] R and pointer > > > > I want to write a function that modify directly variables passed as > > parameters (the equivalent in C langu

Re: [R] R and pointer

2003-08-29 Thread Prof Brian Ripley
On Fri, 29 Aug 2003, Laetitia Marisa wrote: > I want to write a function that modify directly variables passed as > parameters (the equivalent in C language of *ptr/&ptr) so that I don't > have to return a list and to reaffect all my variables. > Is it possible to do so in R? Yes, with the .Ca

Re: [R] R and pointer

2003-08-29 Thread Jeff Gentry
> I want to write a function that modify directly variables passed as > parameters (the equivalent in C language of *ptr/&ptr) so that I don't > have to return a list and to reaffect all my variables. Is it possible > to do so in R? Thanks a lot. You can use environments as they're passed by refer

[R] R and pointer

2003-08-29 Thread Laetitia Marisa
Hi everyone, I want to write a function that modify directly variables passed as parameters (the equivalent in C language of *ptr/&ptr) so that I don't have to return a list and to reaffect all my variables. Is it possible to do so in R? Thanks a lot. Laetitia Marisa. ___