cumsuminv {lazy.tools} | R Documentation |
Inverse of Cummurative Sum
Description
Inverse of Cummurative Sum
Usage
cumsuminv(x)
Arguments
x |
A numeric vector |
Details
This function returns lagged difference of lagg=1 and x[1] as:
c( x[1], diff(x,1) )
Value
A vector of the inverse of cumsum.
Examples
set.seed(1701)
x=sample(1:9,9,replace=1)
y=cumsum(x)
Print(x,y,cumsuminv(y))
[Package lazy.tools version 0.1.6 ]