Readabs Vignette

Zoe Meers

2018-06-01

The readabs package makes reading data from the Australian Bureau of Statistics quick and easy.

There are three functions in the package: - read_abs_data() which loads ABS data into long tidy data frames - read_abs_metadata() which loads ABS metadata into long tidy data frames - read_abs_sdmx() which reads ABS data from the Statistical Data and Metadata eXchange (SDMX).

This document shows you how to efficiently read data from the Australian Bureau of Statistics, allowing you to get on with your analysis of the data as soon as possible.

Read ABS data with read_abs_data()

To read ABS data, run the function read_abs_data(), specifying the file path and the sheet number.

read_abs_data(system.file("extdata", 
"5206002_expenditure_volume_measures.xls",  
package = "readabs", 
mustWork = TRUE), sheet=2)

Read ABS metadata with read_abs_metadata()

The function read_abs_metadata() works much the same way. Make sure to specify the path and sheet number.

read_abs_metadata(system.file("extdata", "5206002_expenditure_volume_measures.xls",  
package = "readabs", 
mustWork = TRUE), sheet=2)

Read ABS SDMX information with read_abs_sdmx()

If you would like to read ABS data on the Statistical Data and Metadata eXchange (SDMX), run read_abs_sdmx(). You must provide a url. The ABS sdmx files can be found at http://www.abs.gov.au/ausstats/abs@.nsf/Lookup/1407.0.55.002Main+Features4User+Guide.

read_abs_sdmx("http://stat.data.abs.gov.au/restsdmx/sdmx.ashx/GetData/ABS_REGIONAL_ASGS/PENSION_2+BANKRUPT_2.AUS.0.A/all?startTime=2013&endTime=2013")