Re: [R] Remembering a value in multiple calls of a function

2009-07-17 Thread Saptarshi Guha
assignments made by this operator are located. > > > Bill Venables > http://www.cmis.csiro.au/bill.venables/ > > > -Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Saptarshi Guha > Sent: Friday, 17 July 2009

Re: [R] Remembering a value in multiple calls of a function

2009-07-17 Thread Bill.Venables
riday, 17 July 2009 5:16 PM To: R-help@r-project.org Subject: [R] Remembering a value in multiple calls of a function Hello, I tried this pseudo-generator style experiment (see below). The "<<-" operator assigns to in the calling environment which would be the environment of "

Re: [R] Remembering a value in multiple calls of a function

2009-07-17 Thread Douglas Bates
On Fri, Jul 17, 2009 at 9:15 AM, Saptarshi Guha wrote: > Hello, > I tried this pseudo-generator style experiment (see below). The "<<-" > operator assigns to in the calling environment which would be the > environment of  "getN". Yes. > Yet when the function incr is returned, isn't this environme

[R] Remembering a value in multiple calls of a function

2009-07-17 Thread Saptarshi Guha
Hello, I tried this pseudo-generator style experiment (see below). The "<<-" operator assigns to in the calling environment which would be the environment of "getN". Yet when the function incr is returned, isn't this environment lost? Also the print displays GlobalEnv, yet the globalenv does not h