cum_var {metools} | R Documentation |
Accumulated variation
Description
cum_var calculates an accumulated variation of a rate, _var means the data must be a percentage variation.
Usage
cum_var(data, colnum, t, div100 = FALSE)
Arguments
data |
a dataframe |
colnum |
number of column |
t |
number of periods to accumulate |
div100 |
divide data by 100, use if data is not fraction |
Value
Return a dataframe.
Examples
v=data.frame(c(0.03,0.02,0.05))
cum_var(v,colnum=1,t=3)
v=data.frame(c('3%','2%','5%'))
v=colpct2num(v,start=1,div100=TRUE)
cum_var(v,colnum=1,t=3)
[Package metools version 1.0.0 Index]