cum_var: Accumulated variation

Description Usage Arguments Value Examples

View source: R/cum_var.R

Description

cum_var calculates an accumulated variation of a rate, _var means the data must be a percentage variation.

Usage

1
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

1
2
3
4
5
6
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)

jvg0mes/metools documentation built on June 28, 2020, 2:38 a.m.