get_resource: Download a resource into your R session

View source: R/get_resource.R

get_resourceR 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 list_package_resources.

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()


opendatatoronto documentation built on April 13, 2022, 5:17 p.m.