[R] Odp: accumulate vector data

Petr PIKAL petr.pikal at precheza.cz
Fri Oct 7 13:56:40 CEST 2011


Hi

?cumsum

Regards
Petr



> 
> Hi,
> 
> 
> 
> What is the best way to accumulate the entries in a vector. For example,
> 
> 
> 
> a <- c(1,2,3,4,5)
> 
> 
> 
> And I want to have
> 
> 
> 
> b <- c(1,3,6,10,15)
> 
> 
> 
> 
> 
> Best,
> 
> Karl
> 
> 
> 
> 
> 
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list