| publicdataau-package | R Documentation |
Search, filter, total and download the Australian government open data republished at https://publicdata.au/, where every version of a dataset is kept at a URL that never changes. Rows and totals come from the site's query API as typed, labelled 'tibble' data frames, and whole tables from its files in any of twelve formats. Map layers come as 'sf' objects, and rows that carry the code of an area join to the Australian Bureau of Statistics boundaries in one call. The 'DuckDB' file of any version can be attached over the web and queried in place with 'DBI' or 'dplyr'. Downloads can be kept in a cache, since a version never changes, the changes between versions are listed row by row, and the source file, fetch time and checksum of every version are on record. Every answer carries the version it came from and the attribution the publisher's licence requires, and citations come as 'BibTeX'. Any dataset the site serves works by its slug, so a new dataset needs no new release.
Every function takes a dataset's slug, the part of its page's URL after '/d/', so a dataset added to the site works with no new release. Start with [pd_datasets()] to find one, [pd_fields()] to see what it holds, then [pd_rows()], [pd_aggregate()], [pd_read()] or [pd_tbl()] to use it.
'TRUE' keeps every downloaded file in [pd_cache_dir()] for reuse. Off by default.
Where the cache is kept.
'TRUE' turns off the licence notice and the download progress bar.
Another copy of the site to read, such as a preview. The 'PUBLICDATA_SITE' environment variable does the same.
Every error the package raises has the class 'publicdataau_error'. One that comes from failing to reach the site also has 'publicdataau_unreachable', and asking [pd_sf()] for a dataset without a map layer has 'publicdataau_no_layer', so either can be caught with 'tryCatch()'. An error answer from the site keeps the classes 'httr2' gives it, such as 'httr2_http_404'.
Maintainer: Cameron Young cameron@nationaldigital.com.au
Authors:
Cameron Young cameron@nationaldigital.com.au
Other contributors:
National Digital [copyright holder, funder]
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.