Learn R Programming

redist (version 2.0.2)

redist.map: Creates a map with optional graph overlay

Description

Creates a map with optional graph overlay

Usage

redist.map(
  shp = NULL,
  district_membership = NULL,
  centroids = TRUE,
  edges = TRUE,
  drop = FALSE,
  title = ""
)

Arguments

shp

A SpatialPolygonsDataFrame or sf object. Required.

district_membership

A numeric vector with one row for each precinct in shp. Used to color the districts. Default is NULL. Optional.

centroids

A logical indicating if centroids should be plotted. Default is TRUE.

edges

A logical indicating if edges should connect adjacent centroids. Default is TRUE.

drop

A logical indicating if edges that cross districts should be dropped. Default is FALSE.

title

A string title of plot. Defaults to empty string. Optional.

Value

ggplot map

Examples

Run this code
# NOT RUN {
library(redist)
data("fl25")
data("algdat.p10")
cds <- algdat.p10$cdmat[,100]
redist.map(shp = fl25, district_membership = cds)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab