powered by
Convert percent per year trend to cumulative trend
convert_ppy_to_cumulative(x, n_years)
A numeric vector of the same length as x that contains the cumulative trend resulting from n_years years of compounding annual trend.
x
n_years
numeric; percent per year trend on the 0-100 scale rather than the 0-1 scale.
integer; number of years.
ppy_trend <- runif(100, min = -100, 100) cumulative_trend <- convert_ppy_to_cumulative(ppy_trend, n_years = 5) cbind(ppy_trend, cumulative_trend)
Run the code above in your browser using DataLab