suggest_component_connection: Suggest Connections for Disconnected Groups

View source: R/contiguity.R

suggest_component_connectionR Documentation

Suggest Connections for Disconnected Groups

Description

Suggests nearest neighbors for connecting a disconnected group.

Usage

suggest_component_connection(shp, adj, group, epsg = 3857)

Arguments

shp

An sf data frame

adj

adjacency list

group

array of group identifiers. Typically district numbers or county names. Defaults to rep(1, length(adj)) if missing.

epsg

numeric EPSG code to planarize to. Default is 3857.

Value

tibble with two columns of suggested rows of shp to connect in adj

Examples

library(dplyr)
data(checkerboard)
checkerboard <- checkerboard %>% filter(i != 1, j != 1)
adj <- adjacency(checkerboard)
suggest_component_connection(checkerboard, adj)


christopherkenny/geomander documentation built on Feb. 18, 2024, 7:58 p.m.