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

Jack Lewis (
Mon, 24 Aug 1998 14:44:38 -0700

Fei Chen wrote:

> ps. can someone give me an example of unavoidable loop? and under what
> general conditions when this happens?hi all,

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

NOTE: 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 To unsubscribe send e-mail to with the BODY of the message: unsubscribe s-news