Get datasets from Vancouver Open Data Portal

get_cov_data(dataset_id, format = c("csv", "geojson"), select = "*",
  where = NULL, apikey = getOption("VancouverOpenDataApiKey"),
  rows = NULL, cast_types = TRUE, refresh = FALSE)

Arguments

dataset_id

Dataset id from the Vancouver Open Data catalogue

format

`csv` or `geojson` are supported at this time (default `csv`)

select

select string for fields to return, returns all fields by default. 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")`

rows

Maximum number of rows to return (default `NULL` returns all rows)

cast_types

Logical, use metadata to look up types and type-cast automatically, default `TRUE`

refresh

refresh cached data, default `FALSE``

Value

tibble or sf object data table output, depending on the value of the `format` parameter

Examples

# Get all parking tickets issued at the 1100 block of Alberni Street between 2017 and 2019 get_cov_data("parking-tickets-2017-2019",where = "block = 1100 AND street = 'ALBERNI ST'")
#> Downloading data from CoV Open Data portal
#> # A tibble: 6,314 x 8 #> block street entrydate bylaw section status infractiontext year #> <int> <chr> <date> <int> <chr> <chr> <chr> <chr> #> 1 1100 ALBERN… 2018-06-15 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2018 #> 2 1100 ALBERN… 2018-06-26 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2018 #> 3 1100 ALBERN… 2018-09-13 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2018 #> 4 1100 ALBERN… 2018-09-13 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2018 #> 5 1100 ALBERN… 2018-03-08 2849 17.1 IS STOP AT A PLACE WHERE A… 2018 #> 6 1100 ALBERN… 2018-03-15 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2018 #> 7 1100 ALBERN… 2019-05-27 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2019 #> 8 1100 ALBERN… 2018-12-12 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2018 #> 9 1100 ALBERN… 2019-03-05 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2019 #> 10 1100 ALBERN… 2017-12-08 2952 5(4)(a)… IS PARK IN A METERED SPACE… 2017 #> # … with 6,304 more rows