| convert_ppy_to_cumulative | R Documentation |
Convert percent per year trend to cumulative trend
convert_ppy_to_cumulative(x, n_years)
x |
numeric; percent per year trend on the 0-100 scale rather than the 0-1 scale. |
n_years |
integer; number of years. |
A numeric vector of the same length as x that contains the
cumulative trend resulting from n_years years of compounding annual
trend.
ppy_trend <- runif(100, min = -100, 100)
cumulative_trend <- convert_ppy_to_cumulative(ppy_trend, n_years = 5)
cbind(ppy_trend, cumulative_trend)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.