[R] running totals in a list

Gábor Csárdi csardi at rmki.kfki.hu
Mon Feb 9 23:15:28 CET 2009


First of all, this is not a list, this is a vector. Second, see ?cumsum.

Best,
Gabor

On Mon, Feb 9, 2009 at 11:13 PM, glenn <g1enn.roberts at btinternet.com> wrote:
>            very simple question I am sure sorry:
>
>
>
> for a list;
>
>
>
> test <-c(1,2,3)
>
>
>
> how do I total them up please to return the result
>
>
>
>
>
> 1,3,6
>
>
>
> Regards
>
>
>
> Glenn
>
>
>
>
>
>
>
>
>        [[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.
>



-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM




More information about the R-help mailing list