Skip to contents

Fetches and imports ABARES trade data. As the data file is large, ~1.4GB uncompressed CSV file, caching is offered to save repeated downloading.

Usage

read_abares_trade(cache = TRUE)

Arguments

cache

Boolean Cache the ABARES trade data locally after download to save download time in the future. Uses tools::R_user_dir to identify the proper directory for storing user data in a cache for this package. Defaults to TRUE, caching the file as a gzipped CSV file. If FALSE, this function uses tempdir() and the files are deleted upon closing of the active R session.

Value

A data.table object of the ABARES trade data.

Note

Columns are renamed for consistency with other ABARES products serviced in this package using a snake_case format and ordered consistently.

The cached file is not the same as the raw file that is available for download. It will follow the renaming scheme and filling values that this function will perform on the raw data.

See also

Examples

if (FALSE) { # interactive()
trade <- read_abares_trade()

trade
}