geo_plot_group: Create Plots of Shapes by Group with Connected Components...

View source: R/plots.R

geo_plot_groupR Documentation

Create Plots of Shapes by Group with Connected Components Colored

Description

Create Plots of Shapes by Group with Connected Components Colored

Usage

geo_plot_group(shp, adj, group, save = FALSE, path = "")

Arguments

shp

An sf shapefile

adj

adjacency list

group

array of group identifiers. Typically district numbers or county names.

save

Boolean, whether to save or not.

path

Path to save, only used if save is TRUE. Defaults to working directory.

Value

list of ggplots

Examples

library(dplyr)
data('checkerboard')
data('checkerboard_adj')

checkerboard <- checkerboard |> mutate(discont = as.integer(j == 5 | j == 6))

p <- geo_plot_group(checkerboard, checkerboard_adj, checkerboard$discont)

p[[1]]
p[[2]]

christopherkenny/geomander documentation built on July 6, 2024, 7:57 a.m.