Description Usage Arguments Value Author(s) Examples
Given vector with variable in percentage the function creates a vector with the variable in accumulated percentage.
1 |
data |
Numeric variable in percentage |
n |
Number of periods to accumulate |
A numeric vector in accumulated percentage.
J. Renato Leripio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
library(tidyverse)
library(tstools)
data <- tibble(Date = seq.Date(from = as.Date("2012-01-01"),
to = as.Date("2018-06-01"),
by = "month"),
V1 = rnorm(mean = 0, sd = 1, n = 78),
V2 = rnorm(mean = 1, sd = 2, n = 78),
V3 = rnorm(mean = 5, sd = 1, n = 78))
data_acum <- dplyr::mutate(data, V1_acum12 = acum_p(V1, 12))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.