pd_aggregate: Totals of a dataset by group

View source: R/publicdataau.R

pd_aggregateR Documentation

Totals of a dataset by group

Description

Totals of a dataset by group

Usage

pd_aggregate(slug, group = NULL, metric = "count", ..., .version = NULL)

Arguments

slug

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

group

Fields to group by.

metric

'"count"', '"sum.<field>"', '"avg.<field>"', '"min.<field>"' or '"max.<field>"', or several of them.

...

Conditions, as for [pd_rows()].

.version

A version date from [pd_versions()]. Without it the answer comes from the newest version and changes when the publisher releases again; with it the answer never changes.

Value

A tibble with one row per group, typed and carrying the same '"publicdata"' attribute as [pd_rows()].

See Also

Other query: filters, pd_connect(), pd_rows(), pd_tbl()

Examples


pd_aggregate("au-road-deaths", group = "state", year = 2025)


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