get_resource {opendatatoronto} | R Documentation |
Download a resource into your R session
Description
Download a resource from the portal directly into your R session. CSV, XLS, XLSX, XML, JSON, SHP, ZIP, and GeoJSON resources are supported.
Usage
get_resource(resource)
Arguments
resource |
A way to identify the resource. Either a resource ID (passed as a character vector directly) or a single resource resulting from |
Value
In most cases, the resource is returned as a tibble or list of tibbles. If it is a spatial resource (i.e. SHP or GeoJSON), it is returned as an sf object.
Examples
list_package_resources("https://open.toronto.ca/dataset/neighbourhoods/") %>%
head(1) %>%
get_resource()
[Package opendatatoronto version 0.1.5 Index]