[R] Decreasing Cumsum Function?

Gundala Viswanath gundalav at gmail.com
Tue Mar 23 02:02:13 CET 2010


Hi all,

I have a frequency data that looks like this.

3
2
1
5

What I want to get is the "decreasing" cumulative of this data
yielding

11
8
6
5
0

Is there any?

I am aware of cumsum(), which will yield
3
5
6
11.

But it is not what I want.

- G.V.



More information about the R-help mailing list