Re: [S] is there a cumouter() like function?

Jack Lewis (jlewis@imtsun.rsl.psw.fs.fed.us)
Mon, 24 Aug 1998 16:21:23 -0700


Oops, what I meant in the example below was:
Given a sequence a[i], i=0,1,2,...,n, and some constant k,
with 0 < k < 1, compute the sequence
b[i] = k*b[i-1] + a[i], i=1,2,...,n
NOT
b[i]= k*a[i-1]+a[i]
Sorry, Jack
P.S. I know it can be done with apply()

Jack Lewis wrote:

> Here is a simple example that I think requires looping,
> (although I'd be thrilled to find out I'm wrong).
> Given a sequence a[i], i=0,1,2,...,n, and some constant k,
> with 0 < k < 1, compute the sequence
> b[i] = k*a[i-1] + a[i], i=1,2,...,n
>
> It may be impossible to state general conditions in S-Plus
> for unavoidable loops, because "avoidance" often just
> means doing the looping with compiled code
> (often internal to S-Plus) from another language
> such as C or Fortran.
> --
> Jack Lewis Redwood Sciences Laboratory
> 707-825-2929 voice Pacific Southwest Research Station
> 707-825-2901 fax USDA Forest Service
> jlewis/psw_rsl@fs.fed.us http://www.rsl.psw.fs.fed.us
>
> NOTE:
> jlewis@rsl.psw.fs.fed.us will be de-activated sometime this summer (1998).
> --------------------------------------------
> Thought must be divided against itself before it can come to any
> knowledge of itself. (Aldous Huxley)
>
> -----------------------------------------------------------------------
> This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
> send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
> message: unsubscribe s-news

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news