Learn R Programming

amapGeocode (version 1.0.0)

extractAdmin: Extract subordinate administrative regions from a district response

Description

Extract subordinate administrative regions from a district response

Usage

extractAdmin(res, include_polyline = FALSE)

Value

A `tibble` describing each administrative region present in the response. The table includes parent metadata (`parent_name`, `parent_adcode`, `parent_level`), centre coordinates (`lng`, `lat`), and a `depth` column describing the nesting level (0 for the matched region, 1+ for subregions). When no results are present a single placeholder row filled with `NA` values is returned.

Arguments

res

Required. Response object returned by [getAdmin()] with `output = "JSON"` or by the AutoNavi district API.

include_polyline

Logical indicating whether to include the polyline column (requires `extensions = "all"`). Defaults to `FALSE`.

See Also

[getAdmin()]

Examples

Run this code
if (FALSE) {
raw <- getAdmin("Sichuan Province", output = "JSON")
extractAdmin(raw)
}

Run the code above in your browser using DataLab