aggregate_cov_data: Get aggregates from dataset from Vancouver Open Data Portal

Description Usage Arguments Value Examples

Description

Get aggregates from dataset from Vancouver Open Data Portal

Usage

1
2
3
4
5
6
7
8
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

1
2
3
4
5
6
7
# Count all parking tickets that relate to fire hydrants by ticket status
## Not run: 
aggregate_cov_data("parking-tickets-2017-2019",
                   group_by = "status",
                   where = "infractiontext LIKE 'FIRE'")

## End(Not run)

VancouvR documentation built on Oct. 21, 2021, 9:07 a.m.