CPI inflator
cpi_inflator(from_nominal_price = 1, from_fy = NULL, to_fy = NULL,
adjustment = c("seasonal", "none", "trimmed.mean"),
useABSConnection = FALSE, allow.projection = TRUE,
accelerate.above = 100000L)
(numeric) the price (or vector of prices) to be inflated
(character) a character vector with each element in the form "2012-13" representing the financial years between which the CPI inflator is desired.
If both from_fy
and to_fy
are NULL
(the default), from_fy
is set to the previous financial year and to_fy
to the current financial year, with a warning. Setting only one is an error.
What CPI index to use ("none" = raw series, "seasonal", or "trimmed" [mean]).
Should the function connect with ABS.Stat via an SDMX connection? If FALSE
(the default), a pre-prepared index table is used. This is much faster and more reliable (in terms of errors), though of course relies on the package maintainer to keep the tables up-to-date.
If the SDMX connection fails, a message is emitted (not a warning) and
the function contines as if useABSConnection = FALSE
.
The internal data was updated on 2019-05-20 to 2019-Q1.
If using useABSConnection = TRUE
, ensure you have rsdmx (>= 0.5-10)
up-to-date.
Should projections beyond the ABS's data be allowed?
An integer setting the threshold for 'acceleration'.
When the maximum length of the arguments exceeds this value, calculate each unique value individually
then combine. Set to 100,000 as a rule of thumb beyond which calculation speeds benefit
dramatically. Can be set to Inf
to disable acceleration.
The value of from_nominal_price
in real (to_fy
) dollars.
# NOT RUN {
cpi_inflator(100, from_fy = "2005-06", to_fy = "2014-15")
# }
Run the code above in your browser using DataLab