[R] cumsum list..

From: yoooooo <magno_yu_at_ml.com>
Date: Thu, 13 Mar 2008 06:02:13 -0700 (PDT)

Hi all, i have the following..

a <- data.frame(data = seq(1,10))

i have indices:
x <- c(1, 5, 3, 9)
y <- c(2, 7, 4, 10)

I want the cumsum of a[1:2], a[5:7], a[3:4]...

is there an elegant way to do it without any loop? Thanks!

View this message in context: http://www.nabble.com/cumsum-list..-tp16025202p16025202.html
Sent from the R help mailing list archive at Nabble.com.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 13 Mar 2008 - 13:07:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 13 Mar 2008 - 18:30:21 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.

list of date sections of archive