Inflators for Australian Policy Analysis
Overview
Using Australian Bureau of Statistics indices, provides functions that convert historical, nominal statistics to real, contemporary values without worrying about date input quality, performance, or the ABS catalogue.
New inflators
- Added
awe_inflator()(all employees' average weekly total earnings) andawote_inflator()(full-time adults' average weekly ordinary time earnings), with original, seasonal and trend data functions and bundled ABS May 2026 data.download_data()includes all six new series. - Earnings snapshot preparation selects series by ID using
readabsor ABS-Catalogue, without release-specific URLs or workbook-position assumptions. Inflate()and custom/forecast series now support regular half-yearly indices. Periods are anchored to the observation month: May to October and November to April for the earnings series, with the usual exact endpoint checks.
Download and validation fixes
- Empty or wholly unsupported
download_data()requests return integer statuses without creating or advancing the last-update marker.
Show all changes in 0.6.0Hide the rest of the changes in 0.6.0
grattanInflators_has_no_data()checks for nonempty files without reading their contents; selecting an index still validates snapshot freshness.- Inflator wrappers report invalid index classes through index validation instead of treating them as missing data.
Bug fixes (memory safety)
Inflate(x = )no longer writes past the end ofxwhenxis shorter thanfrom, and no longer requiresxto be a double: the length is checked in both R and C, and an integerxis coerced (and so must be read back from the return value).- The monthly, quarterly and annual kernels now bounds-check every index position before reading it. An out-of-range date gives
NaN. This check is unconditional:check = 0suppresses diagnostics, never bounds checks. - Zero-length inputs no longer read element zero of an empty vector.
fast_as_idate(),Inflate()and the internalYear()/YearMonthSplit()return empty results. fast_as_idate()no longer indexes before the start of its month table when the month component is zero or a month name is unrecognised (e.g."01/00/2024","01XYZ1948").- Loops that call the R API (
CHAR(),length()) are no longer run under OpenMP, as most of the R API is not thread-safe. - Dates in December 2075, the last month of the supported range, are no longer reported as November: the binary search over the month table could not return its final element.
format_idate()produced impossible strings such as"2075-11-61".
Bug fixes (dates)
- Years are now parsed from all four digits.
"2999-01-01"was silently read as 1999; it is now rejected (orNaNwhencheck = 0). - A financial year now means the same thing to the input checker and to the converter. Previously, for
fy_month >= 7, the two disagreed by one calendar year. - An
<fy>object now means the same thing as the equivalent"YYYY-YY"string. Previously it lost its class during conversion and was read as January of the ending year, whateverfy_monthwas. - A quarter (
"2015-Q1") is now the last month of that quarter everywhere. The checker used Mar/Jun/Sep/Dec and the converter Feb/May/Aug/Nov, which differ on a monthly index. - The input checker now accepts exactly the strings the converter can read: a string of any other length (such as
"2020"), or with arbitrary bytes in the separator positions, is rejected rather than passed and then silently converted toNaN. - A fractional year (
cpi_inflator(2015.9, 2016)) is an error rather than being truncated to 2015.
Bug fixes (fast_as_idate)
format = "%d-%m-%Y"is now supported, as announced in 0.5.2.guess_format()could return it while the parser did not recognise it and read the date year-first instead.- An unrecognised
formatis now an error rather than being read as"%Y-%m-%d". guess_format()now recognises day-first dates beginning 30 or 31, and reports the separator actually used.checknow applies to every format, not only"%Y-%m-%d".
Bug fixes (custom series and forecasting)
dr2index()no longer skips the first period after the end of the published series, and no longer adds a period beyond the requested date..next_date()no longer produces a thirteenth month for a quarterly series anchored in October or November, and clamps the day of the month rather than producing an invalid date.r2index()no longer errors with "object 'next_date' not found".- A trailing rate (
cpi_original(2030, 0.1, 0.05)) is now dispatched correctly. - Rates given as strings keep their sign and exponent:
"-5%"was read as+5%and"1e-2"as12. Rates are now validated against a strict grammar and a rate of -100% or less is rejected. - The non-
fablefallback extension built one more date than value for annual series (producing a recycling warning and a wrong final row), and used quarterly arithmetic for monthly series. Both are fixed. - The
fablepath restores thedata.tablethread count withon.exit(), so a modelling error no longer leaves it changed.
Other changes
- All CPI, wage-price and labour-force series are now bundled with the package, so every inflator works immediately after installation without an internet connection.
download_data()continues to store newer copies in the user data directory. A downloaded copy takes precedence only when its observation coverage is at least as recent as the bundled snapshot, so a cache left by an older package version cannot mask newer bundled data. indexis now validated before use: it must havedateandvaluecolumns, at least two rows, strictly increasing dates forming a regular annual, quarterly or monthly sequence, and finite non-zero values. The native code computes a row offset arithmetically, so an irregular or unsorted index would otherwise be read at the wrong position.- A downloaded series is fully parsed and validated before it replaces the cached file, the replacement is a same-filesystem rename (with the previous version kept alongside as
.bak), and the in-memory copy of a refreshed series is dropped so thatdownload_data()takes effect within a session. GET_SERIES_FY()no longer adds anfycolumn by reference to the cached series.- The test suite now runs the exported inflators on every platform, including machines without internet access, using the bundled ABS data.
- Removed a unit test that had been gated on a date now past, and so had stopped running.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 9 (1 internal)includes a package overview page
- Examples that run
- 100%4 run in a plain check
- Exported functions with examples
- 50%
- Documented parameters
- 76%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Dependencies
Installing grattanInflators adds 5 packages (3 with compiled code, 6.1 MB of source tarballs). Heaviest: data.table 5.7 MB, magrittr 275 KB, hutils 123 KB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.6.0Latest2026-09-11 · current release · diff ↗ ·
added 8 exports
awe_inflator, awe_original, awe_seasonal, awe_trend, awote_inflator, awote_original, awote_seasonal, awote_trend - RR 4.6.0 released · 2026-04-24
- 0.5.7
- RR 4.5.0 released · 2025-04-11
- 0.5.42024-08-21 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.5.32024-04-23 · diff ↗
- 0.5.12024-03-26 · diff ↗
- 0.5.02023-12-01 · diff ↗
- 0.4.22023-08-23 · diff ↗
- 0.4.02023-08-18 · diff ↗ ·
added 13 exports
cpi_monthly_excl_volatile, cpi_monthly_original, cpi_monthly_seasonal, cpi_original, cpi_seasonal, cpi_trimmed_mean, dr2index, lfi_original, lfi_seasonal, lfi_trend, wpi_original, wpi_seasonal, wpi_trend - 0.3.12023-06-12
- RR 4.3.0 released · 2023-04-21
Package metadata
- First published
- 2023-06-12
- Total releases
- 9 / 3 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 4.0.0
- Download size
- 92 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("grattanInflators")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.