Re: [R] using object reference

2004-03-03 Thread Spencer Graves
Yes, but use sparingly, because any use of -, assign, etc., from within a function to change something other than what appears in the standard return from a function call generates spaghetti code that is difficult to maintain. A month or a year from now, someone (the developer or someone

Re: [R] using object reference

2004-03-03 Thread Rajarshi Guha
On Wed, 2004-03-03 at 04:55, Spencer Graves wrote: Yes, but use sparingly, because any use of -, assign, etc., from within a function to change something other than what appears in the standard return from a function call generates spaghetti code that is difficult to maintain. A

RE: [R] using object reference

2004-03-02 Thread Rajarshi Guha
On Tue, 2004-03-02 at 17:16, Andy Bunn wrote: Don't you just need to use return? x - 1 attr(x,'a') - 'some text' f - function(z) { attr(z,'a') - 'some new text' return(z) } y - f(x) y Well what I'm trying to is to pop up a Tk window and allow the user to add some text which gets

RE: [R] using object reference

2004-03-02 Thread Gabor Grothendieck
The double arrow in the example you cite is essential; you can't leave it out since that's what tells R to search through its parents' environments: attr(z,'a') - 'some new text' --- Date: Tue, 02 Mar 2004 16:52:20 -0500 From: Rajarshi Guha [EMAIL PROTECTED] To: R [EMAIL PROTECTED]