powered by
Suggests nearest neighbors for connecting a disconnected group.
suggest_component_connection(shp, adj, group, epsg = 3857)
tibble with two columns of suggested rows of shp to connect in adj
An sf data frame
adjacency list
array of group identifiers. Typically district numbers or county names. Defaults to rep(1, length(adj)) if missing.
numeric EPSG code to planarize to. Default is 3857.
library(dplyr) data(checkerboard) checkerboard <- checkerboard %>% filter(i != 1, j != 1) adj <- adjacency(checkerboard) suggest_component_connection(checkerboard, adj)
Run the code above in your browser using DataLab