Skip to contents

Returns a data.frame with the canonical City of Toronto Open Data schema (_id, AREA_ID, AREA_ATTR_ID, PARENT_AREA_ID, AREA_SHORT_CODE, AREA_LONG_CODE, AREA_NAME, AREA_DESC, CLASSIFICATION, CLASSIFICATION_CODE, OBJECTID, geometry) for the requested version.

Usage

morie_to_neighbourhoods(
  version = c("158", "140", "nia"),
  offline = TRUE,
  resource_id = NULL
)

Arguments

version

One of "158" (current City scheme), "140" (historical 2014–2021 scheme), or "nia" (Neighbourhood Improvement Areas).

offline

If TRUE (default), read the small bundled synthetic fixture from inst/extdata/. If FALSE, hit the live City of Toronto CKAN datastore_search endpoint via httr2.

resource_id

Optional CKAN resource id override. Used only when offline = FALSE.

Value

A data.frame.

References

City of Toronto Open Data, "Neighbourhoods" dataset (https://open.toronto.ca/dataset/neighbourhoods/); "Neighbourhood Improvement Areas" (https://open.toronto.ca/dataset/neighbourhood-improvement-areas/); licensed under the Open Government Licence – Toronto.

Examples

df <- morie_to_neighbourhoods("158", offline = TRUE)
head(df[, c("AREA_SHORT_CODE", "AREA_NAME")])
#>   AREA_SHORT_CODE                 AREA_NAME
#> 1             174 South Eglinton-Davisville
#> 2             173             North Toronto
#> 3             172        Dovercourt Village
#> 4             171  Junction-Wallace Emerson
#> 5             170        Yonge-Bay Corridor
#> 6             169            Bay-Cloverhill