View source: R/get_inflation_factor.R
| get_inflation_factor | R Documentation |
This function calculates the inflation factor based on inflation rate.
get_inflation_factor(n_years, inflation_rate = NULL, is_deflation = FALSE)
n_years |
|
inflation_rate |
|
is_deflation |
|
Methodology
This function is called inside monetize().
It calculates the inflation factor based on the inflation rate and the number of years into the future as described in \insertCiteBrealey2023_book;textualhealthiar.
If inflation_rate contains one single value,
inflation is assumed to be constant over time and
the inflation factor increases exponentially with the number of years.
If inflation_rate contains a vector of year-specific rates,
the inflation factor is the product of the year-specific factors,
which better reflects that inflation varies over time.
In that case, inflation_rate must contain
at least as many values as years to be considered (n_years),
the first value referring to the first year after the present.
Detailed information about the methodology (including equations) is available in the package vignette. More specifically, see chapters:
This function returns the numeric inflation factor.
Alberto Castro & Axel Luyten
Alternative: monetize
# Constant inflation rate
get_inflation_factor(
inflation_rate = 0.02,
n_years = 5
)
# Year-specific inflation rates
get_inflation_factor(
inflation_rate = c(0.02, 0.03, 0.05, 0.04, 0.02),
n_years = 5
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.