inflator: Inflate using a general index

View source: R/inflator.R

inflatorR Documentation

Inflate using a general index

Description

Inflate using a general index

Usage

inflator(
  x = 1,
  from,
  to,
  inflator_table,
  index.col = "Index",
  time.col = "Time",
  roll = NULL,
  max.length = NULL
)

Arguments

x

The vector to be inflated.

from

The contemporaneous time of x.

to

The target time (in units of the inflator_table) to which x is to be inflated.

inflator_table

A data.table having columns index.col and time.col.

index.col

The column in inflator_table containing the index used for inflation.

time.col

The column in inflator_table by which times are mapped.

roll

If NULL, inflation is calculated only on exact matches in inflator_table. Otherwise, uses a rolling join. See data.table::data.table.

max.length

(Internal use only). If not NULL, the maximum length of x, from, and to known in advance. May be provided to improve the performance if known.

Value

A vector of inflated values. For example, inflator_table = grattan:::cpi_seasonal_adjustment, index.col = "obsValue", time.col = "obsTime", gives the CPI inflator.


grattan documentation built on Sept. 4, 2023, 5:08 p.m.