Divides by a price index and rescales so that values are expressed in
prices of base_year.
Usage
deflate(
x,
price_index,
years = NULL,
base_year = NULL,
index_years = years,
index_values = price_index
)Arguments
- x
Numeric vector of nominal values.
- price_index
Price index for the same observations as
x(for example the BEA GDP deflator, 2017 = 100).- years
Optional years of the observations; needed with
base_year.- base_year
Year whose prices the result is expressed in. If
NULL, the index is assumed to equal 100 in the base year and the result isx * 100 / price_index.- index_years, index_values
Optional full index series used to look up the base-year value when
base_yearis not amongyears.