Skip to contents

An R package for automated downloading and ingestion of data from the Australian Bureau of Agricultural and Resource Economics and Sciences. Not all ABARES data are serviced. The list is hand-picked to be reasonably useful and maintainable, i.e., frequently updated values are not included in this, e.g., Australian crop reports. However, if there is a data set that you feel would be useful to be serviced by {read.abares}, please feel free to open an issue with details about the data set or better yet, open a pull request!

Data serviced include:

The files are freely available as CSV files, zip archives of NetCDF files or a zip archives of geospatial shape files. {read.abares} facilitates downloading, caching and importing these files in your R session with your choice of the class of the resulting object(s).

Get Started

Installation

{read.abares} is not available through CRAN (yet). But you can install it like so:

if (!require("remotes"))
  install.packages("remotes")
remotes::install_git("https://github.com/adamhsparks/read.abares")

Features

Caching

{read.abares} supports caching the files using tools::R_user_dir(package = "read.abares", which = "cache") to save the files in a standardised location across platforms so you don’t have to worry about where the files went or if they’re still there. When requesting the files, {read.abares} will first check if they are available locally either in cached or temporary storage. Caching is not mandatory, you can just work with the downloaded files in tempdir(), which is cleaned up when your R session ends.

Multiple Classes Supported

{read.abares} supports multiple classes of objects to support your workflow. Select from spatial classes for the AGFD NetCDF files:

or data.frame (data.table) objects:

Metadata

Please report any issues or bugs.

License: MIT

Citations

Citing the data: Please refer to the ABARES website, https://www.agriculture.gov.au/abares/products/citations, on how to cite these data when you use them.

Citing {read.abares}: When citing the use of this package, please use,

library("read.abares")
#> 
#> Attaching package: 'read.abares'
#> The following object is masked from 'package:graphics':
#> 
#>     plot
#> The following object is masked from 'package:base':
#> 
#>     plot
citation("read.abares")
#> To cite package 'read.abares' in publications use:
#> 
#>   Sparks A (????). _read.abares: Simple downloading and importing of
#>   ABARES Data_. R package version 1.0.0,
#>   <https://adamhsparks.github.io/read.abares/>.
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {{read.abares}: Simple downloading and importing of ABARES Data},
#>     author = {Adam H. Sparks},
#>     note = {R package version 1.0.0},
#>     url = {https://adamhsparks.github.io/read.abares/},
#>   }

Contributing

A Note on Testing

I’ve aimed to make the testing for this package as complete as possible. Some of the files downloaded are >1GB and may take several minutes or more than an hour to download and due to their size, I do not wish to include them in the package itself. Therefore, most of these tests do rely on already downloaded and locally cached files. If you wish to work with development of {read.abares} please be aware that it will take some time to establish your local cache before testing will be somewhat faster.

I am considering including some pared down examples for tests as the data are released under a CC By 4.0 License, but for now have opted to just use locally cached data for simplicity.

Code of Conduct

Please note that the {read.abares} project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.