Message-ID: <941871A13165C2418EC144ACB212BDB002123D19@dshsmxoly1504g.dshs.wa.lcl>
Date: 2011-10-05T19:15:12Z
From: Nordlund, Dan (DSHS/RDA)
Subject: "stepwise" sum
In-Reply-To: <1317823590115-3874606.post@n4.nabble.com>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of behave
> Sent: Wednesday, October 05, 2011 7:07 AM
> To: r-help at r-project.org
> Subject: [R] "stepwise" sum
>
> dear R-Community
>
> is there a function which sums data "stepwise"
>
> exp:
>
> 2
> 1
> 4
> 5
>
> Desired result
>
> 2 = 2
> 2+1 = 3
> 2+1+4 = 7
> 2+1+4+5 = 12
>
> Is there a built in function for this?
>
> Thx
> Dom
>
>
?cumsum
Hope this is helpful,
Dan
Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204