R/read_cpi.R
read_cpi.Rd
read_cpi()
uses the read_abs()
function to download, import,
and tidy the Consumer Price Index from the ABS. It returns a tibble
containing two columns: the date and the CPI index value that corresponds
to that date. This makes joining the CPI to another dataframe easy.
read_cpi()
returns the original (ie. not seasonally adjusted)
all groups CPI for Australia. If you want the analytical series
(eg. seasonally adjusted CPI, or trimmed mean CPI), you can use
read_abs()
.
read_cpi(
path = Sys.getenv("R_READABS_PATH", unset = tempdir()),
show_progress_bars = TRUE,
check_local = FALSE,
retain_files = FALSE
)
character; default is "data/ABS". Only used if retain_files is set to TRUE. Local directory in which to save downloaded ABS time series spreadsheets.
logical; TRUE by default. If set to FALSE, progress bars will not be shown when ABS spreadsheets are downloading.
logical; FALSE by default. See ?read_abs
.
logical; FALSE by default. When TRUE, the spreadsheets downloaded from the ABS website will be saved in the directory specified with 'path'.
# Create a tibble called 'cpi' that contains the CPI index
# numbers for each quarter
# \donttest{
cpi <- read_cpi()
#> Finding URLs for tables corresponding to ABS catalogue 6401.0
#> Attempting to download files from catalogue 6401.0, Consumer Price Index, Australia
#> Extracting data from downloaded spreadsheets
#> Tidying data from imported ABS spreadsheets
# }
# This tibble can now be joined to another to help streamline the process of
# deflating nominal values.