Re: [R] Define "local" function

2005-04-16 Thread Duncan Murdoch
Peter Dalgaard wrote: Ales Ziberna <[EMAIL PROTECTED]> writes: I am also very interested how this could be done, possibly in such a way that this would be incorporated in the function itself and there wouldn't be a need to write "environment(f) <- NULL" before calling a function, as is proposed in

Re: [R] Define "local" function

2005-04-15 Thread Peter Dalgaard
Ales Ziberna <[EMAIL PROTECTED]> writes: > I am also very interested how this could be done, possibly in such a > way that this would be incorporated in the function itself and there > wouldn't be a need to write "environment(f) <- NULL" before calling a > function, as is proposed in the reply bel

Re: [R] Define "local" function

2005-04-15 Thread Gabor Grothendieck
- > From: "Gabor Grothendieck" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: "Submissions to R help" > Sent: Friday, April 15, 2005 5:05 PM > Subject: Re: [R] Define "local" function > > > On 4/15/05, Fernando Saldanha <[EMA

Re: [R] Define "local" function

2005-04-15 Thread Ales Ziberna
s ago! Thanks for any suggestions, Ales Ziberna - Original Message - From: "Gabor Grothendieck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "Submissions to R help" Sent: Friday, April 15, 2005 5:05 PM Subject: Re: [R] Define "local" function

Re: [R] Define "local" function

2005-04-15 Thread Gabor Grothendieck
On 4/15/05, Fernando Saldanha <[EMAIL PROTECTED]> wrote: > I discovered a bug in a program I am writing which was due to the > program using a global variable within a function. > > For example, > > myfunc <- function(x) { y} > > That is, I made a mistake when defining the function and wrote "y"

Re: [R] Define "local" function

2005-04-15 Thread Roger D. Peng
This came up just a few days ago on the mailing list! Check the archives here: https://stat.ethz.ch/pipermail/r-help/2005-April/067639.html -roger Fernando Saldanha wrote: I discovered a bug in a program I am writing which was due to the program using a global variable within a function. For exa

[R] Define "local" function

2005-04-15 Thread Fernando Saldanha
I discovered a bug in a program I am writing which was due to the program using a global variable within a function. For example, myfunc <- function(x) { y} That is, I made a mistake when defining the function and wrote "y" when I should have written "x". However, there was a variable y in the