Learn R Programming

raustats: An R package for accessing ABS and RBA statistics

An R package for downloading Australian economic statistics from the Australian Bureau of Statistics (ABS) and Reserve Bank of Australia (RBA) websites.

Installation

You can install the released version of raustats from CRAN with:

install.packages("raustats")

or the latest development version from github with:

devtools::install_github("mitcda/raustats")

How to use raustats

To learn more about the raustats package, start with the vignettes:

browseVignettes(package = "raustats")

Introduction

The Australian Bureau of Statistics (ABS) is Australia’s national statistical agency, providing trusted official statistics on a wide range of economic, social, population and environmental matters of importance to Australia. Key ABS statistical collections include:

  • Australian National Accounts
  • International Trade
  • Consumer Price Index (CPI)
  • Labour Force
  • Population trends

The Reserve Bank of Australia (RBA) is Australia’s central bank. In addition to its legislative responsibilities, it collects and publishes statistics on money, credit, the Australian banking systems and other relevant economic metrics. Key RBA statistics include:

  • Banking system assets and liabilities
  • Money and credit statistics
  • Household and business finances
  • Interest rates
  • Exchange rates
  • Inflation and inflation expectations.

The ABS and RBA make their statistics primarily available through Excel and/or CSV spreadsheets.

This package provides functions to search and download data and statistics from the Australian Bureau of Statistics (ABS) and Reserve Bank of Australia (RBA) websites, as well as draft access to the ABS.Stat - Beta data catalogue API.

Examples

Downloading ABS Catalogue Statistics

ABS catalogue statistics may be downloaded, by catalogue number, using the abs_cat_stats() function. The following example downloads all Consumer Price Index (CPI) data series (ABS Catalogue no. 6401.0).

cpi_all <- abs_cat_stats("6401.0")

To download only the latest statistics reported in Table 1 (ABS groups Tables 1 and 2), simply provide a regular expression to the tables argument:

cpi <- abs_cat_stats("6401.0", tables="Table.+1")

The package also provides functions to ABS statistics via the ABS.Stat Beta API. See the package help and vignettes for examples.

Downloading RBA data

RBA data series may be downloaded by table number, using the rba_stats() function. The following example downloads Table A1 - Liabilities and Assets of the RBA.

rba_bs <- rba_stats("A1")

Copy Link

Version

Install

install.packages('raustats')

Monthly Downloads

6

Version

0.15.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

David Mitchell

Last Published

January 9th, 2020

Functions in raustats (0.15.0)

abs_cat_releases

Return ABS catalogue table releases
abs_cachelist

Datasets available through the ABS API
abs_cat_stats

Get ABS catalogue series data
rba_stats

Return data for a specified RBA time series
abs_read_tss

Extract data from an ABS time series data file
abs_metadata

Download dataset metadata from the ABS API
raustats

raustats: An R package for accessing data and statistics from the ABS and RBA websites
abs_call_api

Submit API call to ABS.Stat
raustats_check_url_available

Check specified ABS/RBA URL available
abs_datasets

Download ABS.Stat datasets
abs_cat_download

Function to download files from the ABS website and store locally
abs_cat_cachelist

List of ABS catalogue tables
abs_local_filename

Create local file names for storing downloaded ABS data files
abs_urls

ABS URL addresses and paths used in accessing ABS Catalogue data calls
abs_dimensions

Return available dimensions of ABS series
quarter2Date

Convert dates formatted as year-quarter to dates objects
rba_file_download

Function to download statistics files from the RBA website and store locally
aus_state_codes

Table of Australian state and territory codes
excel2Date

Convert Excel numeric date to R Date object
rba_urls

RBA base URL and data paths
abs_api_call

Create ABS.Stat API URL call
fin_year

Create financial year date object
rba_search

Return list of data tables from RBA website
rba_read_tss

Read RBA statistical time series spreadsheet
abs_api_urls

ABS URL addresses and paths used in ABS.Stat API calls
abs_filetypes

Valid ABS file types
rba_table_cache

Return list of RBA tables
last_day

Set Date object to the last day of the month
abs_cat_unzip

Uncompress locally-stored ABS Catalogue data file archives
abs_cat_tables

Return ABS catalogue tables
abs_search

Search dataset information from the ABS.Stat API
abs_stats

Download data from the ABS API
raustats_ua

raustats package user agent
rba_cachelist

Cached list of statistical tables provided by the RBA