Skip to contents

Download, cache and import the Australian Agricultural and Grazing Industries Survey (AAGIS) regions geospatial shapefile.

Usage

read_aagis_regions(cache = TRUE)

Arguments

cache

Cache the AAGIS regions' geospatial file after downloading using tools::R_user_dir("read.abares", "cache") to identify the proper directory for storing user data in a cache for this package. Defaults to TRUE, caching the files locally as a GeoPackage. If FALSE, this function uses tempdir() and the files are deleted upon closing of the active R session.

Value

An sf object of the AAGIS regions and a cached geopackage file if requested.

Details

@note Upon import a few operations are carried out,

  • the geometries are automatically corrected to fix invalid geometries that are present in the original shapefile,

  • column names are set to start with an upper-case letter,

  • the original column named, "name", is set to "AAGIS_region" to align with column names that the data.table::data.table() provided by read_historical_regional_estimates() to allow for easier merging of data for mapping, and,

  • a new column, "State" is added to be used for mapping state estimates with data for mapping state historical estimate values found in the data.table::data.table() from read_historical_state_estimates().

Examples

if (FALSE) { # interactive()
aagis <- read_aagis_regions()

plot(aagis)
}