Learn R Programming

onemapsgapi (version 1.1.0)

get_planning_names: Get Planning Area Names

Description

This function is a wrapper for the Names of Planning Area API. It returns the data as a tibble.

Usage

get_planning_names(token, year = NULL)

Value

A tibble with 2 columns:

id

Planning area id

pln_area_n

Planning area name

Arguments

token

User's API token. This can be retrieved using get_token

year

Optional, check documentation for valid options. Invalid requests will are ignored by the API.

Examples

Run this code
# returns tibble
if (FALSE) get_planning_names(token)
if (FALSE) get_planning_names(token, 2008)

# error: output is NULL, warning message shows status code
if (FALSE) get_planning_names("invalid_token")

Run the code above in your browser using DataLab