Learn R Programming

geomander (version 2.3.0)

geo_plot_group: 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 = "")

Value

list of ggplots

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.

Examples

Run this code
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]]

Run the code above in your browser using DataLab