> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of behave > Sent: Wednesday, October 05, 2011 7:07 AM > To: r-help@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 ______________________________________________ R-help@r-project.org 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.