This is a decreasing version of cumsum.

inv_cumsum(x)

Arguments

x

numerical vector

Examples

cumsum(1:10)
#>  [1]  1  3  6 10 15 21 28 36 45 55
inv_cumsum(1:10)
#>  [1] 55 54 52 49 45 40 34 27 19 10