Learn R Programming

geomander (version 2.3.0)

check_polygon_contiguity: Check Polygon Contiguity

Description

Cast shp to component polygons, build the adjacency, and check the contiguity. Avoids issues where a precinct is actually a multipolygon

Usage

check_polygon_contiguity(shp, group, epsg = 3857)

Value

tibble with a column for each of inputted group, created group number, and the identified connected component number

Arguments

shp

An sf data frame

group

unquoted name of group identifier in shp. Typically, this is district assignment. If you're looking for dis-contiguous precincts, this should be a row number.

epsg

numeric EPSG code to planarize to. Default is 3857.

Examples

Run this code
data(checkerboard)
check_polygon_contiguity(checkerboard, i)

Run the code above in your browser using DataLab