geo_plot_group | R Documentation |
Create Plots of Shapes by Group with Connected Components Colored
geo_plot_group(shp, adj, group, save = FALSE, path = "")
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. |
list of ggplots
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]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.