Re: [R] how to store recursive results

From: X.H Chen <xchen_stat_at_hotmail.com>
Date: Fri 22 Sep 2006 - 15:31:23 GMT


Hi Gabor,

Thanks for pointing out this for me. However, what I try to get is how to construct such form a function f that

ret<-f(...),

where ret contains the each recursive result from f, and meantime f consists of no <<- operator. Do you have any idea how to implemet this. Thanks a lot for your suggestions.

Cheer

Xiaohui Chen

Dept. of Statistics
UBC, Canada

>From: "Gabor Grothendieck" <ggrothendieck@gmail.com>
>To: "X.H Chen" <xchen_stat@hotmail.com>
>CC: r-help@stat.math.ethz.ch
>Subject: Re: [R] how to store recursive results
>Date: Fri, 22 Sep 2006 06:49:22 -0400
>
>Note that <<- is not necessarily global:
>
>if (exists("x")) rm(x)
>f <- function() {
> x <- 2
> g <- function() x <<- 3
> g()
> x
>}
>f() # 3
>exists("x") # FALSE
>
>On 9/22/06, X.H Chen <xchen_stat@hotmail.com> wrote:
>>Hi all,
>>
>>How to store recursive resutls from a function for each step without using
>>global operators <<-? Thanks ahead.
>>
>>Xiaohui Chen
>>
>>Dept. of Statistics
>>UBC, Canada
>>
>>_________________________________________________________________
>>Don't waste time standing in line—try shopping online. Visit Sympatico /
>>MSN
>>
>>
>>
>>______________________________________________
>>R-help@stat.math.ethz.ch mailing list
>>
https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide
>>http://www.R-project.org/posting-guide.html
>>and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>



Buy what you want when you want it on Sympatico / MSN Shopping



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Sep 23 01:33:10 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 22 Sep 2006 - 16:30:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.