| pd_aggregate | R Documentation |
Totals of a dataset by group
pd_aggregate(slug, group = NULL, metric = "count", ..., .version = NULL)
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. |
A tibble with one row per group, typed and carrying the same '"publicdata"' attribute as [pd_rows()].
Other query:
filters,
pd_connect(),
pd_rows(),
pd_tbl()
pd_aggregate("au-road-deaths", group = "state", year = 2025)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.