pd_download: Download one version's file

View source: R/publicdataau.R

pd_downloadR Documentation

Download one version's file

Description

Download one version's file

Usage

pd_download(
  slug,
  format = "parquet",
  version = NULL,
  path = NULL,
  table = NULL,
  cache = NULL
)

Arguments

slug

The dataset's slug, as in its page URL 'https://publicdata.au/d/<slug>/'.

format

One of '"parquet"', '"csv"', '"csv.gz"', '"json"', '"ndjson"', '"sqlite"', '"duckdb"', '"xlsx"', '"arrow"', '"geojson"', '"gpkg"' or '"geo.parquet"'. The last three are served only for datasets with a location or a shape.

version

A version date from [pd_versions()]. The newest when 'NULL'.

path

Where to save the file. When ‘NULL', a file in the session’s temporary directory named for the slug and version, or the file in the cache when 'cache' is on.

table

For a database, one of its tables, which is served as Parquet. See [pd_tables()].

cache

Keep the file in [pd_cache_dir()] and reuse it next time. Versions never change, so a kept file never goes stale. Off unless 'options(publicdataau.cache = TRUE)' is set.

Value

The path of the saved file, invisibly, with the version it resolved to in 'attr(path, "version")'.

See Also

Other files: cache, pd_read(), pd_url()

Examples


f <- pd_download("qld-road-crash-factors", "csv")


publicdataau documentation built on Oct. 14, 2026, 5:07 p.m.