Description Usage Arguments Details Value See Also Examples
sometimes should convert current value to cumulative value if necessity, although using current value is common.
1 | current2cumulative(x, cycle = 12, start = 1)
|
x |
a numeric vector or a data frame |
cycle |
12 if monthly ; 4 if seasonal ... |
start |
start month or quarter ... |
No matter what class of x
(vector or data.frame), output value will be a data frame.
If x
is data frame, progress will convert it's all columns to cumulative value.
A data frame.
cumulative2current
1 2 3 4 5 6 7 8 9 | a = c(1:10)
b = c(1,3,6,1,8,4,2,9,10,3)
c = c(rep(c(1,2,3),c(2,3,5)))
df = data.frame(a,b,c)
current2cumulative(df,cycle = 5,start = 1 )
current2cumulative(df,cycle = 5,start = 2 )
current2cumulative(df,cycle = 5,start = 7 ) # fail
current2cumulative(df,cycle = 25 ) # when cycle > nobs.
current2cumulative(df,cycle = 50,50 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.