Description Usage Arguments Value Examples
pct_change calculate the percentual change in t periods of a serie. We can use this function to calculate the acumulated variation of an index, for example to calculate the accumulated variation in 12 months just set t parameter to 12
1 |
data |
a dataframe |
colnum |
number of column |
t |
number of periods to accumulate (default= number of rows) |
nafill |
set value to fill NA's before first t value |
Return a dataframe.
1 2 | v=data.frame(test=c(1,2,3,4,5,6,7,8,9,10,11,12,13))
pct_change(v)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.