Skip to contents

Optional helper. Requires httr2 (and jsonlite via the existing morie_arsau_read_sidecar contract).

Usage

morie_arsau_fetch_sidecar(kind, year, limit = 5000L, timeout_sec = 30L)

Arguments

kind

One of ARSAU_KINDS().

year

One of ARSAU_YEARS().

limit

Integer; CKAN limit parameter. Default 5000.

timeout_sec

Request timeout in seconds. Default 30.

Value

A list with fields and records, ready for morie_arsau_sidecar_schema / morie_arsau_sidecar_to_frame.

References

Ontario Data Catalogue CKAN API.

Examples

# \donttest{
res <- try(morie_arsau_fetch_sidecar(ARSAU_KINDS()[1], ARSAU_YEARS()[1],
  limit = 50L
))
if (!inherits(res, "try-error")) str(res, max.level = 1)
#> List of 2
#>  $ fields :List of 7
#>  $ records:List of 50
# }