[R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think a little harder on implementation style (especially to spare users complex

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 11:52 AM, Simon Zehnder szehn...@uni-bonn.de wrote: Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
it lets you do: (a~b~c) = foo() Mistook. should be: (a~b~c) %=% foo() because it defines the %=% operator. Barry __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Modify objects in function

2013-01-31 Thread Barry Rowlingson
On Thu, Jan 31, 2013 at 3:00 PM, Simon Zehnder szehn...@uni-bonn.de wrote: Hi Barry, this actually a good idea, to put them together! Probably even creating an object containing both of them. Haven't thought about it before. Hadley W asked for implementations of 'unstructuring assignments'

Re: [R] Modify objects in function

2013-01-31 Thread Gabor Grothendieck
On Thu, Jan 31, 2013 at 6:52 AM, Simon Zehnder szehn...@uni-bonn.de wrote: Dear R community, I do know, that an R function is constructing a copy of any object passed as argument into a function. I program on a larger S4 project for a package, and I arrived at a point where I have to think

Re: [R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Dear Barry, thank you very much for this information. This looks pretty interesting! Best Simon On Jan 31, 2013, at 4:09 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: it lets you do: (a~b~c) = foo() Mistook. should be: (a~b~c) %=% foo() because it defines the %=%

Re: [R] Modify objects in function

2013-01-31 Thread Simon Zehnder
Hi Barry, this actually a good idea, to put them together! Probably even creating an object containing both of them. Haven't thought about it before. Best Simon On Jan 31, 2013, at 3:49 PM, Barry Rowlingson b.rowling...@lancaster.ac.uk wrote: On Thu, Jan 31, 2013 at 11:52 AM, Simon Zehnder