Get aggregates from dataset from Vancouver Open Data Portal

aggregate_cov_data(dataset_id, select = "count(*) as count",
  group_by = NULL, where = NULL,
  apikey = getOption("VancouverOpenDataApiKey"), refresh = FALSE)

Arguments

dataset_id

Dataset id from the Vancouver Open Data catalogue

select

select string for aggregation, default is `count(*) as count` It accepts ODSQL syntax.

group_by

grouping variables for the query It accepts ODSQL syntax.

where

Query parameter to filter data (default `NULL` no filter) It accepts ODSQL syntax.

apikey

Vancouver Open Data API key, default `getOption("VancouverOpenDataApiKey")`

refresh

refresh cached data, default `FALSE``

Value

tibble format data table output

Examples

# Count all parking tickets that relate to fire hydrants by ticket status aggregate_cov_data("parking-tickets-2017-2019", group_by = "status", where = "infractiontext LIKE 'FIRE'")
#> Downloading data from CoV Open Data portal
#> # A tibble: 3 x 2 #> status count #> <chr> <int> #> 1 IS 9510 #> 2 VA 1765 #> 3 WR 14